Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
WIP fix for Jruby spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Aug 19, 2024
1 parent 645ae0d commit c114a2c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/rspec/support/spec/stderr_splitter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@

# This is essentially what the `to_stderr_from_any_process` matcher attempts
# to do in CaptureStreamToTempfile.
it 'is able to restore the stream from a cloned StdErrSplitter', :pending => RSpec::Support::Ruby.jruby? do
cloned = $stderr.clone
expect($stderr.to_io).not_to be_a(File)
it 'is able to restore the stream from a cloned StdErrSplitter' do
cloned = splitter.clone
expect(splitter.to_io).not_to be_a(File)

tempfile = Tempfile.new("foo")
begin
$stderr.reopen(tempfile)
expect($stderr.to_io).to be_a(File)
splitter.reopen(tempfile)
expect(splitter.to_io.path).to eq(tempfile.path)
ensure
$stderr.reopen(cloned)
splitter.reopen(cloned)
tempfile.close
tempfile.unlink
end
expect($stderr.to_io).not_to be_a(File)
expect(splitter.to_io.path).not_to eq tempfile.path
end
end

0 comments on commit c114a2c

Please sign in to comment.