File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -375,11 +375,11 @@ def http_stub
375375 end
376376
377377 def unstub_http?
378- HttpMock . net_connection_enabled? && defined? ( @http ) && @http . kind_of? ( HttpMock )
378+ HttpMock . net_connection_enabled? && ( ! defined? ( @http ) || @http . kind_of? ( HttpMock ) )
379379 end
380380
381381 def stub_http?
382- HttpMock . net_connection_disabled? && defined? ( @http ) && @http . kind_of? ( Net ::HTTP )
382+ HttpMock . net_connection_disabled? && ( ! defined? ( @http ) || @http . kind_of? ( Net ::HTTP ) )
383383 end
384384 end
385385 end
Original file line number Diff line number Diff line change @@ -312,6 +312,13 @@ def test_enable_net_connection
312312 end
313313 end
314314
315+ def test_enable_net_connection_first_time
316+ keep_net_connection_status do
317+ ActiveResource ::HttpMock . enable_net_connection!
318+ assert @conn . send ( :http ) . kind_of? ( Net ::HTTP )
319+ end
320+ end
321+
315322 def test_disable_net_connection
316323 keep_net_connection_status do
317324 ActiveResource ::HttpMock . enable_net_connection!
You can’t perform that action at this time.
0 commit comments