test/test_import_cvs.rb in autobuild-0.6.3 vs test/test_import_cvs.rb in autobuild-0.6.4
- old
+ new
@@ -30,16 +30,30 @@
assert( File.exists?(File.join(pkg_cvs.srcdir, 'test')) )
# Make an update
importer.import(pkg_cvs)
- # Make an update fail
+ # Make an update fail because the repository does not exist anymore
FileUtils.rm_rf cvsroot
assert_raise(Autobuild::SubcommandFailed) { importer.import pkg_cvs }
- # Make a checkout fail
+ # Make a checkout fail because the repository does not exist anymore
FileUtils.rm_rf pkg_cvs.srcdir
assert_raise(Autobuild::SubcommandFailed) { importer.import pkg_cvs }
+
+ # Recreate the repository, and make a checkout fail because the
+ # WC is not a CVS WC
+ TestTools.untar('cvsroot.tar')
+ FileUtils.mkdir pkg_cvs.srcdir
+ assert_raise(Autobuild::ConfigException) { importer.import pkg_cvs }
+
+ # Create two repositories, and make the update fail because the
+ # WC is of the wrong source
+ FileUtils.rm_rf pkg_cvs.srcdir
+ importer.import(pkg_cvs)
+ FileUtils.mv cvsroot, "#{cvsroot}.2"
+ importer = Autobuild.cvs("#{cvsroot}.2", 'cvs')
+ assert_raise(Autobuild::ConfigException) { importer.import pkg_cvs }
end
end