diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-08-23 12:39:03 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-08-23 12:39:03 +0300 |
commit | 86e7de7968b91bd4256bb07ffbe689b385180910 (patch) | |
tree | 13ecddcae4458b078703ffab3d0c7cbb1e80a756 /actioncable/lib | |
parent | d2ccf0c6f767d6a8170c2ea0160e51cb8cd29a78 (diff) | |
download | rails-86e7de7968b91bd4256bb07ffbe689b385180910.tar.gz rails-86e7de7968b91bd4256bb07ffbe689b385180910.tar.bz2 rails-86e7de7968b91bd4256bb07ffbe689b385180910.zip |
DRY in `assert_broadcasts`
Test `assert_no_broadcasts` failure
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/test_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actioncable/lib/action_cable/test_helper.rb b/actioncable/lib/action_cable/test_helper.rb index 9092c8b80e..7bc877663c 100644 --- a/actioncable/lib/action_cable/test_helper.rb +++ b/actioncable/lib/action_cable/test_helper.rb @@ -47,11 +47,12 @@ module ActionCable original_count = broadcasts_size(stream) yield new_count = broadcasts_size(stream) - assert_equal number, new_count - original_count, "#{number} broadcasts to #{stream} expected, but #{new_count - original_count} were sent" + actual_count = new_count - original_count else actual_count = broadcasts_size(stream) - assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent" end + + assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent" end # Asserts that no messages have been sent to the stream. |