spec/warbler/task_spec.rb in warbler-1.4.3 vs spec/warbler/task_spec.rb in warbler-1.4.4
- old
+ new
@@ -136,26 +136,26 @@
Warbler::ZipSupport.open("#{config.jar_name}.war") do |zf|
class_file_bytes = zf.get_input_stream('WEB-INF/lib/ruby_one_nine.class') {|io| io.read }
java_class_header = class_file_bytes[0..3]
bytecode_version = class_file_bytes[6..7]
-
+
java_class_header.should == java_class_magic_number
bytecode_version.should == java6_version_bytes
end
end
it "should delete .class files after finishing the jar" do
config.features << "compiled"
silence { run_task "warble" }
- File.exist?('app/helpers/application_helper.class').should be_false
+ File.exist?('app/helpers/application_helper.class').should be false
end
context "where symlinks are available" do
begin
FileUtils.ln_s "README.txt", "r.txt.symlink", :verbose => false
-
+
it "should process symlinks by storing a file in the archive that has the same contents as the source" do
File.open("config/special.txt", "wb") {|f| f << "special"}
Dir.chdir("config") { FileUtils.ln_s "special.txt", "link.txt" }
silence { run_task "warble" }
Warbler::ZipSupport.open("#{config.jar_name}.war") do |zf|
@@ -167,23 +167,23 @@
it "should process directory symlinks by copying the whole subdirectory" do
Dir.chdir("lib") { FileUtils.ln_s "tasks", "rakelib" }
silence { run_task "warble" }
Warbler::ZipSupport.open("#{config.jar_name}.war") do |zf|
- zf.find_entry("WEB-INF/lib/tasks/utils.rake").should_not be_nil
- zf.find_entry("WEB-INF/lib/rakelib/").should_not be_nil
- zf.find_entry("WEB-INF/lib/rakelib/utils.rake").should_not be_nil if defined?(JRUBY_VERSION)
+ zf.find_entry("WEB-INF/lib/tasks/utils.rake").should_not be nil
+ zf.find_entry("WEB-INF/lib/rakelib/").should_not be nil
+ zf.find_entry("WEB-INF/lib/rakelib/utils.rake").should_not be nil if defined?(JRUBY_VERSION)
end
end
FileUtils.rm_f "r.txt.symlink", :verbose => false
rescue NotImplementedError
end
end
context "with a Bundler Gemfile" do
-
+
run_out_of_process_with_drb if DRB = true
after do
if DRB
drbclient.run_task "warble:clean"
@@ -192,21 +192,21 @@
end
end
it "includes gems from the Gemfile" do
File.open("Gemfile", "w") {|f| f << "gem 'rspec'"}
-
+
if DRB
drbclient.run_task "warble"
config = drbclient.config
else
- silence { run_task "warble" }
+ silence { run_task "warble" }
end
-
+
Warbler::ZipSupport.open("#{config.jar_name}.war") do |zf|
rspec = config.gems.keys.detect { |spec| spec.name == 'rspec' }
- rspec.should_not be_nil, "expected rspec gem among: #{config.gems.keys.join(' ')}"
- zf.find_entry("WEB-INF/gems/specifications/rspec-#{rspec.version}.gemspec").should_not be_nil
+ rspec.should_not be(nil), "expected rspec gem among: #{config.gems.keys.join(' ')}"
+ zf.find_entry("WEB-INF/gems/specifications/rspec-#{rspec.version}.gemspec").should_not be nil
end
end
end
end