$:.unshift File.join(File.dirname(__FILE__), "..", "..", '..', "lib", 'buildmaster') require 'spec' require 'project/svn_admin_driver' require 'cotta' require 'cotta/in_memory_system' module BuildMaster describe SvnDriver do before do file = File.expand_path(__FILE__) test_dir = Cotta.new.file(file).parent.parent.parent.dir('tmp/svn_test') test_dir.delete if (test_dir.exists?) test_dir.mkdirs @repository = test_dir.dir('repository') @url = "file:///#{@repository.path}" @svn_admin = SvnAdminDriver.new(@repository.path) @svn_admin.create @work_dir_root = test_dir.dir('workdir') @svn = SvnDriver.new @work_dir_root end it 'check out, add, commit, update' do second = @work_dir_root.parent.dir('second') second_svn = SvnDriver.new(second) @svn.checkout(@url) second_svn.checkout(@url) @work_dir_root.file('test.txt').save('my testing content') @svn.add(@work_dir_root.file('test.txt')) @svn.commit('testing the checkin') second_svn.update second.file('test.txt').load.should == 'my testing content' svn2 = SvnDriver.from_path(second) svn2.work_dir.should == second_svn.work_dir svn2.repository_url.should == second_svn.repository_url svn2.user.should_not be(nil) svn2.repository_root.should == second_svn.repository_root end =begin def expect_info @system.should_receive(:shell).with("svn info #{@work_dir_root.path}").and_return(<