diff options
Diffstat (limited to 'actioncable')
-rw-r--r-- | actioncable/test/channel/periodic_timers_test.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/actioncable/test/channel/periodic_timers_test.rb b/actioncable/test/channel/periodic_timers_test.rb index 0cc4992ef6..17a8e45a35 100644 --- a/actioncable/test/channel/periodic_timers_test.rb +++ b/actioncable/test/channel/periodic_timers_test.rb @@ -38,23 +38,26 @@ class ActionCable::Channel::PeriodicTimersTest < ActiveSupport::TestCase 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 + e = assert_raise ArgumentError do ChatChannel.periodically :send_updates, every: invalid end + assert_match(/Expected every:/, e.message) end end test "disallow block and arg together" do - assert_raise ArgumentError, /not both/ do + e = assert_raise ArgumentError do ChatChannel.periodically(:send_updates, every: 1) { ping } end + assert_match(/not both/, e.message) end test "disallow unknown args" do [ "send_updates", Object.new, nil ].each do |invalid| - assert_raise ArgumentError, /Expected a Symbol/ do + e = assert_raise ArgumentError do ChatChannel.periodically invalid, every: 1 end + assert_match(/Expected a Symbol/, e.message) end end |