test/buildmaster/tc_java_manifest.rb in BuildMaster-0.8.1 vs test/buildmaster/tc_java_manifest.rb in BuildMaster-0.9.0
- old
+ new
@@ -1,23 +1,51 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "..", "lib")
-require 'test/unit'
+require 'spec'
require 'buildmaster'
+require 'buildmaster/cotta'
+require 'buildmaster/cotta/in_memory_system'
module BuildMaster
-class JavaManifestTest < Test::Unit::TestCase
- def test_loading_manifest
- manifest = JavaManifest.new(File.join(File.dirname(__FILE__), "manifest.mf"))
+context 'JavaManifestTest' do
+ setup do
+ @cotta = Cotta.new(InMemorySystem.new)
+ end
+
+ teardown do
+ @cotta = nil
+ end
+
+ specify 'loading_manifest' do
+ file = @cotta.file('dir/manifest.mf')
+ file.save(<<CONTENT
+Implementation-Version: 2.3.3
+Implementation-Build: 1139
+
+Implementation-Vendor: Vendor
+Implementation-Number: Number
+CONTENT
+)
+ manifest = JavaManifest.new(file)
version = manifest.version
- assert_equal(version.number, "2.3.3")
+ "2.3.3".should_equal version.number
end
- def test_increase_build
- manifest = JavaManifest.new(File.join(File.dirname(__FILE__), "manifest.mf"))
+ specify 'increase_build' do
+ file = @cotta.file('dir/manifest.mf')
+ file.save(<<CONTENT
+Implementation-Version: 2.3.3
+Implementation-Build: 1139
+
+Implementation-Vendor: Vendor
+Implementation-Number: Number
+CONTENT
+)
+ manifest = JavaManifest.new(file)
build_number = manifest.version.build
version = manifest.increase_build
- assert_equal(version.build, build_number + 1)
- assert_equal(version.build, manifest.version.build)
+ (build_number + 1).should_equal version.build
+ manifest.version.build.should_equal version.build
end
end
end
\ No newline at end of file