aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/test_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/lib/action_cable/test_helper.rb')
-rw-r--r--actioncable/lib/action_cable/test_helper.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actioncable/lib/action_cable/test_helper.rb b/actioncable/lib/action_cable/test_helper.rb
index dbd5ec3b16..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.
@@ -125,7 +126,7 @@ module ActionCable
delegate :broadcasts, :clear_messages, to: :pubsub_adapter
private
- def broadcasts_size(channel) # :nodoc:
+ def broadcasts_size(channel)
broadcasts(channel).size
end
end