test/buildmaster/tc_svn_driver.rb in BuildMaster-0.9.0 vs test/buildmaster/tc_svn_driver.rb in BuildMaster-0.9.1
- old
+ new
@@ -10,77 +10,71 @@
context 'SVN drivers' do
setup do
@system = InMemorySystem.new
cotta = Cotta.new(@system)
@work_dir_root = cotta.dir('/workdir')
- @work_dir_root.dir('.svn').file('entries').save <<CONTENT
-<?xml version="1.0" encoding="utf-8"?>
-<wc-entries
- xmlns="svn:">
-<entry
- committed-rev="120"
- name=""
- committed-date="2006-09-05T06:50:07.932800Z"
- url="svn+ssh://wolfdancer@rubyforge.org/var/svn/buildmaster/trunk"
- last-author="wolfdancer"
- kind="dir"
- uuid="ab7ff8c2-9713-0410-a269-a4b56b3120d2"
- repos="svn+ssh://wolfdancer@rubyforge.org/var/svn/buildmaster"
- prop-time="2006-09-05T06:49:40.625000Z"
- revision="120"/>
-</wc-entries>
+ @system.output_for_command("svn info #{@work_dir_root.path}", <<CONTENT
+Path: .
+URL: svn+ssh://wolfdancer@rubyforge.org/var/svn/buildmaster/trunk
+Repository Root: svn+ssh://wolfdancer@rubyforge.org/var/svn/buildmaster
+Repository UUID: ab7ff8c2-9713-0410-a269-a4b56b3120d2
+Revision: 153
+Node Kind: directory
+Schedule: normal
+Last Changed Author: wolfdancer
+Last Changed Rev: 153
+Last Changed Date: 2006-10-15 21:27:51 -0700 (Sun, 15 Oct 2006)
CONTENT
- @info = SvnInfo.new @work_dir_root
+)
+ @svn = SvnDriver.new @work_dir_root
end
- specify 'load svn info from the .svn directory' do
- info = SvnInfo.new(@work_dir_root)
- info.work_dir.should_equal @work_dir_root
- info.repository_root.should_equal 'svn+ssh://wolfdancer@rubyforge.org/var/svn/buildmaster'
+ specify 'load svn info from the info command' do
+ @svn.work_dir.should_equal @work_dir_root
+ @svn.repository_root.should_equal 'svn+ssh://wolfdancer@rubyforge.org/var/svn/buildmaster'
end
specify 'load svn driver from the root directory' do
- svn = SvnDriver.from_path(@work_dir_root)
- svn.command('info')
+ @svn.command('info')
end
specify 'svn status command' do
log = ''
- svn = SvnDriver.new(@info)
- svn.status
+ @svn.status
@system.executed_commands[0].should_equal "svn status #{@work_dir_root.path}"
end
specify 'svn update command' do
log = ''
- svn = SvnDriver.new(@info)
- svn.update
+ @svn.update
@system.executed_commands[0].should_equal "svn update #{@work_dir_root.path}"
end
specify 'svn commit command' do
- svn = SvnDriver.new(@info)
- svn.commit('message')
+ @svn.commit('message')
@system.executed_commands[0].should_equal "svn commit #{@work_dir_root.path} -m \"message\""
end
specify 'svn check out command' do
- svn = SvnDriver.new(@info)
- svn.checkout('output')
- @system.executed_commands[0].should_equal "svn checkout #{@info.repository_root}/trunk output"
+ @svn.checkout('output')
+ @system.executed_commands[0].should_equal "svn checkout #{@svn.repository_root}/trunk output"
end
specify 'svn command' do
- svn = SvnDriver.new(@info)
- svn.command('info')
+ @svn.command('info')
@system.executed_commands[0].should_equal "svn info #{@work_dir_root.path}"
end
specify 'svn tag' do
- svn = SvnDriver.new(@info)
tag = 'build_0.0.5_b3'
- svn.tag(tag)
- @system.executed_commands[0].should_equal "svn copy #{@info.repository_root}/trunk #{@info.repository_root}/tags/#{tag} -m \"ruby buildmaster\""
+ @svn.tag(tag)
+ @system.executed_commands[0].should_equal "svn copy #{@svn.repository_root}/trunk #{@svn.repository_root}/tags/#{tag} -m \"ruby buildmaster\""
+ end
+
+ specify 'physical svn works' do
+ cotta = Cotta.new
+ svn = SvnDriver.new(cotta.file(__FILE__).parent)
+ svn.repository_root.should_equal 'svn+ssh://wolfdancer@rubyforge.org/var/svn/buildmaster'
end
end
end
\ No newline at end of file