spec/lib/spec_generator_spec.rb in gjp-0.19.0 vs spec/lib/spec_generator_spec.rb in gjp-0.20.0
- old
+ new
@@ -13,11 +13,11 @@
@project.dry_run
Dir.chdir(@project_path) do
test_file = File.join("kit", "test")
File.open(test_file, "w") { |io| io.puts "kit content test file" }
end
- @project.finish
+ @project.finish(false)
@spec_generator = Gjp::SpecGenerator.new(@project)
end
after(:each) do
@@ -44,11 +44,11 @@
File.open(File.join("specs", "test-project-kit.spec"), "a") do |io|
io.write("nonconflicting line")
end
end
- @project.finish
+ @project.finish(false)
@spec_generator.generate_kit_spec.should be_true
@project.from_directory do
spec_lines = File.readlines(File.join("specs", "test-project-kit.spec"))
@@ -72,20 +72,23 @@
File.open(spec_path, "w+") do |io|
io.write(spec_contents)
end
end
- @project.finish
+ @project.finish(false)
@spec_generator.generate_kit_spec.should be_true
@project.from_directory do
spec_lines = File.readlines(File.join("specs", "test-project-kit.spec"))
spec_lines.should include("Name: test-project-kit\n")
spec_lines.should include("Source0: %{name}.tar.xz\n")
+ spec_lines.should include("<<<<<<< newly generated\n")
+ spec_lines.should include("Version: 2\n")
+ spec_lines.should include("=======\n")
spec_lines.should include("CONFLICTING!\n")
- spec_lines.should_not include("Version: 2\n")
+ spec_lines.should include(">>>>>>> user edited\n")
end
end
end
describe "#generate_package_spec" do
@@ -104,21 +107,21 @@
(1..5).each do |i|
`touch src/test/out/test#{i}.jar`
end
- @project.finish
+ @project.finish(false)
end
@spec_generator.generate_package_spec "test", File.join("spec", "data", "nailgun", "pom.xml"), "*.jar"
@project.from_directory do
spec_lines = File.readlines(File.join("specs", "test.spec"))
spec_lines.should include("Name: test\n")
spec_lines.should include("License: The Apache Software License, Version 2.0\n")
spec_lines.should include("Summary: Nailgun is a client, protocol, and server for running Java\n")
spec_lines.should include("Url: http://martiansoftware.com/nailgun\n")
- spec_lines.should include("BuildRequires: #{@project.name}-kit\n")
+ spec_lines.should include("BuildRequires: #{@project.name}-kit >= 2\n")
spec_lines.should include("Provides: mvn(com.martiansoftware:nailgun-all) == 0.9.1\n")
spec_lines.should include("cp -a out/test3.jar %{buildroot}%{_javadir}/test3.jar\n")
end
end
end