@@ -145,7 +145,7 @@ class RubyExeSpecs
145
145
stub_const 'RUBY_EXE' , 'ruby_spec_exe -w -Q'
146
146
147
147
@script = RubyExeSpecs . new
148
- allow ( @script ) . to receive ( :` ) . and_return ( 'OUTPUT' )
148
+ allow ( IO ) . to receive ( :popen ) . and_return ( 'OUTPUT' )
149
149
150
150
status_successful = double ( Process ::Status , exited? : true , exitstatus : 0 )
151
151
allow ( Process ) . to receive ( :last_status ) . and_return ( status_successful )
@@ -155,7 +155,7 @@ class RubyExeSpecs
155
155
code = "code"
156
156
options = { }
157
157
output = "output"
158
- allow ( @script ) . to receive ( :` ) . and_return ( output )
158
+ expect ( IO ) . to receive ( :popen ) . and_return ( output )
159
159
160
160
expect ( @script . ruby_exe ( code , options ) ) . to eq output
161
161
end
@@ -168,7 +168,7 @@ class RubyExeSpecs
168
168
code = "code"
169
169
options = { }
170
170
expect ( @script ) . to receive ( :ruby_cmd ) . and_return ( "ruby_cmd" )
171
- expect ( @script ) . to receive ( :` ) . with ( "ruby_cmd" )
171
+ expect ( IO ) . to receive ( :popen ) . with ( "ruby_cmd" )
172
172
@script . ruby_exe ( code , options )
173
173
end
174
174
@@ -227,7 +227,7 @@ class RubyExeSpecs
227
227
expect ( ENV ) . to receive ( :[]= ) . with ( "ABC" , "xyz" )
228
228
expect ( ENV ) . to receive ( :[]= ) . with ( "ABC" , "123" )
229
229
230
- expect ( @script ) . to receive ( :` ) . and_raise ( Exception )
230
+ expect ( IO ) . to receive ( :popen ) . and_raise ( Exception )
231
231
expect do
232
232
@script . ruby_exe nil , :env => { :ABC => "xyz" }
233
233
end . to raise_error ( Exception )
@@ -248,7 +248,7 @@ class RubyExeSpecs
248
248
249
249
it "does not raise exception when command ends with expected status" do
250
250
output = "output"
251
- allow ( @script ) . to receive ( :` ) . and_return ( output )
251
+ expect ( IO ) . to receive ( :popen ) . and_return ( output )
252
252
253
253
expect ( @script . ruby_exe ( "path" , exit_status : 4 ) ) . to eq output
254
254
end
0 commit comments