From 0e42d3db59593b7641ed42efaddc69b315a36f7e Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Thu, 23 Aug 2018 12:30:16 +0300 Subject: Clarify api docs of ActionCable::SubscriptionAdapter::Test Remove extra `:nodoc:` comment since private methods doesn't require that. --- actioncable/lib/action_cable/subscription_adapter/test.rb | 2 +- actioncable/lib/action_cable/test_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'actioncable/lib/action_cable') diff --git a/actioncable/lib/action_cable/subscription_adapter/test.rb b/actioncable/lib/action_cable/subscription_adapter/test.rb index 52226a7c71..ce604cc88e 100644 --- a/actioncable/lib/action_cable/subscription_adapter/test.rb +++ b/actioncable/lib/action_cable/subscription_adapter/test.rb @@ -9,7 +9,7 @@ module ActionCable # The test adapter should be used only in testing. Along with # ActionCable::TestHelper it makes a great tool to test your Rails application. # - # To use the test adapter set adapter value to +test+ in your +cable.yml+. + # To use the test adapter set +adapter+ value to +test+ in your +config/cable.yml+ file. # # NOTE: Test adapter extends the ActionCable::SubscriptionsAdapter::Async adapter, # so it could be used in system tests too. diff --git a/actioncable/lib/action_cable/test_helper.rb b/actioncable/lib/action_cable/test_helper.rb index dbd5ec3b16..9092c8b80e 100644 --- a/actioncable/lib/action_cable/test_helper.rb +++ b/actioncable/lib/action_cable/test_helper.rb @@ -125,7 +125,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 -- cgit v1.2.3 From 86e7de7968b91bd4256bb07ffbe689b385180910 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Thu, 23 Aug 2018 12:39:03 +0300 Subject: DRY in `assert_broadcasts` Test `assert_no_broadcasts` failure --- actioncable/lib/action_cable/test_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actioncable/lib/action_cable') 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. -- cgit v1.2.3