This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change 99
99
expect ( splitter . to_io ) . not_to eq ( splitter . clone . to_io )
100
100
end
101
101
102
- # This is essentially what the `to_stderr_from_any_process` matcher attempts
103
- # to do in CaptureStreamToTempfile.
104
- it 'is able to restore the stream from a cloned StdErrSplitter' , :pending => RSpec ::Support ::Ruby . jruby? do
105
- cloned = $stderr. clone
106
- expect ( $stderr. to_io ) . not_to be_a ( File )
102
+ # This spec replicates what matchers do when capturing stderr, e.g `to_stderr_from_any_process`
103
+ it 'is able to restore the stream from a cloned StdErrSplitter' do
104
+ if RSpec ::Support ::Ruby . jruby?
105
+ skip "" "
106
+ This spec is currently unsupported on JRuby on CI due to tempfiles not being
107
+ a file, this situtation was discussed here https://github.com/rspec/rspec-support/pull/598#issuecomment-2200779633
108
+ " ""
109
+ end
110
+
111
+ cloned = splitter . clone
112
+ expect ( splitter . to_io ) . not_to be_a ( File )
107
113
108
114
tempfile = Tempfile . new ( "foo" )
109
115
begin
110
- $stderr . reopen ( tempfile )
111
- expect ( $stderr . to_io ) . to be_a ( File )
116
+ splitter . reopen ( tempfile )
117
+ expect ( splitter . to_io ) . to be_a ( File )
112
118
ensure
113
- $stderr . reopen ( cloned )
119
+ splitter . reopen ( cloned )
114
120
tempfile . close
115
121
tempfile . unlink
116
122
end
117
- expect ( $stderr. to_io ) . not_to be_a ( File )
123
+ # This is the important part of the test that would fail without proper cloning hygeine
124
+ expect ( splitter . to_io ) . not_to be_a ( File )
118
125
end
119
126
end
You can’t perform that action at this time.
0 commit comments