aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/connection/stream_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/connection/stream_test.rb')
-rw-r--r--actioncable/test/connection/stream_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actioncable/test/connection/stream_test.rb b/actioncable/test/connection/stream_test.rb
index 1e1466af31..daf7c37c79 100644
--- a/actioncable/test/connection/stream_test.rb
+++ b/actioncable/test/connection/stream_test.rb
@@ -2,6 +2,7 @@
require "test_helper"
require "active_support/testing/method_call_assertions"
+require "minitest/mock"
require "stubs/test_server"
class ActionCable::Connection::StreamTest < ActionCable::TestCase
@@ -44,10 +45,11 @@ class ActionCable::Connection::StreamTest < ActionCable::TestCase
# Internal hax = :(
client = connection.websocket.send(:websocket)
- client.instance_variable_get("@stream").instance_variable_get("@rack_hijack_io").expects(:write).raises(closed_exception, "foo")
-
- assert_called(client, :client_gone) do
- client.write("boo")
+ rack_hijack_io = client.instance_variable_get("@stream").instance_variable_get("@rack_hijack_io")
+ rack_hijack_io.stub(:write, proc { raise(closed_exception, "foo") }) do
+ assert_called(client, :client_gone) do
+ client.write("boo")
+ end
end
assert_equal [], connection.errors
end