diff options
author | Arthur Nogueira Neves <github@arthurnn.com> | 2017-01-30 20:16:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 20:16:30 -0500 |
commit | 543f19626b80e72c543306b6ca67421df3a42d6c (patch) | |
tree | 5f1c9ab0575b88f4fdd92949389d82d4cebdd3d0 /actioncable/test/channel/periodic_timers_test.rb | |
parent | 4e5c2ccc1d97f0c18834f616fc219be6b1531bde (diff) | |
parent | c42bd31977d601a743a154cf5a614459b51a3cb3 (diff) | |
download | rails-543f19626b80e72c543306b6ca67421df3a42d6c.tar.gz rails-543f19626b80e72c543306b6ca67421df3a42d6c.tar.bz2 rails-543f19626b80e72c543306b6ca67421df3a42d6c.zip |
Merge pull request #27797 from y-yagi/correctly_check_error_message
correctly check error message
Diffstat (limited to 'actioncable/test/channel/periodic_timers_test.rb')
-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 |