diff options
Diffstat (limited to 'actioncable/test/connection/stream_test.rb')
-rw-r--r-- | actioncable/test/connection/stream_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/actioncable/test/connection/stream_test.rb b/actioncable/test/connection/stream_test.rb index a7a61d8d6f..4128b32f15 100644 --- a/actioncable/test/connection/stream_test.rb +++ b/actioncable/test/connection/stream_test.rb @@ -1,5 +1,5 @@ -require 'test_helper' -require 'stubs/test_server' +require "test_helper" +require "stubs/test_server" class ActionCable::Connection::StreamTest < ActionCable::TestCase class Connection < ActionCable::Connection::Base @@ -34,17 +34,17 @@ class ActionCable::Connection::StreamTest < ActionCable::TestCase [ EOFError, Errno::ECONNRESET ].each do |closed_exception| test "closes socket on #{closed_exception}" do - skip if ENV['FAYE'].present? + skip if ENV["FAYE"].present? run_in_eventmachine do connection = open_connection # Internal hax = :( client = connection.websocket.send(:websocket) - client.instance_variable_get('@stream').instance_variable_get('@rack_hijack_io').expects(:write).raises(closed_exception, 'foo') + client.instance_variable_get("@stream").instance_variable_get("@rack_hijack_io").expects(:write).raises(closed_exception, "foo") client.expects(:client_gone) - client.write('boo') + client.write("boo") assert_equal [], connection.errors end end @@ -52,10 +52,10 @@ class ActionCable::Connection::StreamTest < ActionCable::TestCase private def open_connection - env = Rack::MockRequest.env_for '/test', - 'HTTP_CONNECTION' => 'upgrade', 'HTTP_UPGRADE' => 'websocket', - 'HTTP_HOST' => 'localhost', 'HTTP_ORIGIN' => 'http://rubyonrails.com' - env['rack.hijack'] = -> { env['rack.hijack_io'] = StringIO.new } + env = Rack::MockRequest.env_for "/test", + "HTTP_CONNECTION" => "upgrade", "HTTP_UPGRADE" => "websocket", + "HTTP_HOST" => "localhost", "HTTP_ORIGIN" => "http://rubyonrails.com" + env["rack.hijack"] = -> { env["rack.hijack_io"] = StringIO.new } Connection.new(@server, env).tap do |connection| connection.process |