gentoo-full-overlay/dev-ruby/test-spec/files/test-spec-0.10.0-jruby.patch

26 lines
1 KiB
Diff

diff -rN -u old-testspec/lib/test/spec/should-output.rb new-testspec/lib/test/spec/should-output.rb
--- old-testspec/lib/test/spec/should-output.rb 2010-01-17 01:44:15.172753274 +0100
+++ new-testspec/lib/test/spec/should-output.rb 2010-01-17 01:44:15.174753161 +0100
@@ -11,8 +11,13 @@
# Store the old stream
old_to = to.dup
+ # Instead of using out.path, save here the path we're going to
+ # write to. This is needed because JRuby does not change the class
+ # from IO to File, and thus will lack a path method).
+ out_filename = File.join(Dir.tmpdir, "should_output_#{$$}")
+
# Obtain a filehandle to replace (works with Readline)
- to.reopen File.open(File.join(Dir.tmpdir, "should_output_#{$$}"), "w+")
+ to.reopen File.open(out_filename, "w+")
# Execute
@object.call
@@ -44,6 +49,6 @@
rescue Errno::EPIPE
end
- FileUtils.rm_f out.path
+ FileUtils.rm_f out_filename
end # output
end # Test::Spec::Should