diff options
Diffstat (limited to 'actioncable')
-rw-r--r-- | actioncable/Rakefile | 2 | ||||
-rw-r--r-- | actioncable/lib/action_cable/connection/stream.rb | 6 | ||||
-rw-r--r-- | actioncable/test/connection/client_socket_test.rb | 1 | ||||
-rw-r--r-- | actioncable/test/javascript/vendor/mock-socket.js | 3 |
4 files changed, 6 insertions, 6 deletions
diff --git a/actioncable/Rakefile b/actioncable/Rakefile index 226d171104..fb75d14363 100644 --- a/actioncable/Rakefile +++ b/actioncable/Rakefile @@ -57,7 +57,7 @@ namespace :assets do end print "[verify] #{file} is a UMD module " - if pathname.read =~ /module\.exports.*define\.amd/m + if /module\.exports.*define\.amd/m.match?(pathname.read) puts "[OK]" else $stderr.puts "[FAIL]" diff --git a/actioncable/lib/action_cable/connection/stream.rb b/actioncable/lib/action_cable/connection/stream.rb index 4873026b71..e658948a55 100644 --- a/actioncable/lib/action_cable/connection/stream.rb +++ b/actioncable/lib/action_cable/connection/stream.rb @@ -98,8 +98,10 @@ module ActionCable def hijack_rack_socket return unless @socket_object.env["rack.hijack"] - @socket_object.env["rack.hijack"].call - @rack_hijack_io = @socket_object.env["rack.hijack_io"] + # This should return the underlying io according to the SPEC: + @rack_hijack_io = @socket_object.env["rack.hijack"].call + # Retain existing behaviour if required: + @rack_hijack_io ||= @socket_object.env["rack.hijack_io"] @event_loop.attach(@rack_hijack_io, self) end diff --git a/actioncable/test/connection/client_socket_test.rb b/actioncable/test/connection/client_socket_test.rb index 9176c7ac8b..a7db32c3e4 100644 --- a/actioncable/test/connection/client_socket_test.rb +++ b/actioncable/test/connection/client_socket_test.rb @@ -41,7 +41,6 @@ class ActionCable::Connection::ClientSocketTest < ActionCable::TestCase # Internal hax = :( client = connection.websocket.send(:websocket) client.instance_variable_get("@stream").stub(:write, proc { raise "foo" }) do - assert_not_called(client, :client_gone) do client.write("boo") end diff --git a/actioncable/test/javascript/vendor/mock-socket.js b/actioncable/test/javascript/vendor/mock-socket.js index b465c8b53f..4564cebc40 100644 --- a/actioncable/test/javascript/vendor/mock-socket.js +++ b/actioncable/test/javascript/vendor/mock-socket.js @@ -178,7 +178,7 @@ if (root.IPv6 === this) { root.IPv6 = _IPv6; } - + return this; } @@ -461,7 +461,6 @@ }(this, function (punycode, IPv6, SLD, root) { 'use strict'; /*global location, escape, unescape */ - // FIXME: v2.0.0 renamce non-camelCase properties to uppercase /*jshint camelcase: false */ // save current URI variable, if any |