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

Commit ceb2c96

Browse files
committed
Use === instead of is_a?
For some reason, jruby (in ci only) is failing the new test, rejecting the assertion that the reopened $stderr is now a File. That's _fair_, changing the class of a thing after it exists doesn't seem like it should be possible, and I don't know how it is; it wouldn't surprise me if jruby _also_ assumes that can't happen somewhere..
1 parent da06053 commit ceb2c96

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spec/rspec/support/spec/stderr_splitter_spec.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,20 @@
103103
# to do in CaptureStreamToTempfile.
104104
it 'is able to restore the stream from a cloned StdErrSplitter' do
105105
cloned = $stderr.clone
106-
expect($stderr.to_io).not_to be_a(File)
106+
expect(File === $stderr.to_io).to be_falsey
107107

108108
tempfile = Tempfile.new("foo")
109+
109110
begin
110111
$stderr.reopen(tempfile)
111-
expect($stderr.to_io).to be_a(File)
112+
expect(File === $stderr.to_io).to be_truthy
113+
@checked = true
112114
ensure
113115
$stderr.reopen(cloned)
114116
tempfile.close
115117
tempfile.unlink
116118
end
117-
expect($stderr.to_io).not_to be_a(File)
119+
expect(File === $stderr.to_io).to be_falsey
120+
expect(@checked).to be_truthy
118121
end
119122
end

0 commit comments

Comments
 (0)