aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/channel/periodic_timers_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/channel/periodic_timers_test.rb')
-rw-r--r--actioncable/test/channel/periodic_timers_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/actioncable/test/channel/periodic_timers_test.rb b/actioncable/test/channel/periodic_timers_test.rb
index 03464003cf..529abb9535 100644
--- a/actioncable/test/channel/periodic_timers_test.rb
+++ b/actioncable/test/channel/periodic_timers_test.rb
@@ -1,7 +1,7 @@
-require 'test_helper'
-require 'stubs/test_connection'
-require 'stubs/room'
-require 'active_support/time'
+require "test_helper"
+require "stubs/test_connection"
+require "stubs/room"
+require "active_support/time"
class ActionCable::Channel::PeriodicTimersTest < ActiveSupport::TestCase
class ChatChannel < ActionCable::Channel::Base
@@ -36,22 +36,22 @@ class ActionCable::Channel::PeriodicTimersTest < ActiveSupport::TestCase
end
end
- test 'disallow negative and zero periods' do
- [ 0, 0.0, 0.seconds, -1, -1.seconds, 'foo', :foo, Object.new ].each do |invalid|
+ test "disallow negative and zero periods" do
+ [ 0, 0.0, 0.seconds, -1, -1.seconds, "foo", :foo, Object.new ].each do |invalid|
assert_raise ArgumentError, /Expected every:/ do
ChatChannel.periodically :send_updates, every: invalid
end
end
end
- test 'disallow block and arg together' do
+ test "disallow block and arg together" do
assert_raise ArgumentError, /not both/ do
ChatChannel.periodically(:send_updates, every: 1) { ping }
end
end
- test 'disallow unknown args' do
- [ 'send_updates', Object.new, nil ].each do |invalid|
+ test "disallow unknown args" do
+ [ "send_updates", Object.new, nil ].each do |invalid|
assert_raise ArgumentError, /Expected a Symbol/ do
ChatChannel.periodically invalid, every: 1
end
@@ -60,7 +60,7 @@ class ActionCable::Channel::PeriodicTimersTest < ActiveSupport::TestCase
test "timer start and stop" do
@connection.server.event_loop.expects(:timer).times(3).returns(stub(shutdown: nil))
- channel = ChatChannel.new @connection, "{id: 1}", { id: 1 }
+ channel = ChatChannel.new @connection, "{id: 1}", id: 1
channel.unsubscribe_from_channel
assert_equal [], channel.send(:active_periodic_timers)