Skip to content

Commit

Permalink
Use Tempfile.create to get an actual IO
Browse files Browse the repository at this point in the history
Tempfile.new under the standard tempfile library returns a
Delegate wrapped around an IO, so it would not have our JI addons.

See jruby#7973
  • Loading branch information
headius committed Nov 8, 2023
1 parent 499826d commit f9aac38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/java_integration/addons/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
before(:all) { require 'tempfile' }

it "is coercible to java.io.File" do
file = Tempfile.new("io_spec").to_java 'java.io.File'
file = Tempfile.create("io_spec").to_java 'java.io.File'
expect(java.io.File).to be === file
file = File.open(__FILE__).to_java java.io.File
expect(java.io.File).to be === file
Expand Down
2 changes: 1 addition & 1 deletion spec/java_integration/addons/io_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@


it "is coercible using to_java to java.io.OutputStream" do
file = Tempfile.new("io_spec")
file = Tempfile.create("io_spec")
stream = file.to_java 'java.io.OutputStream'
expect(java.io.OutputStream).to be === stream

Expand Down

0 comments on commit f9aac38

Please sign in to comment.