From 211adb47e76b358ea15a3f756431c042ab231c23 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Wed, 24 Jan 2018 22:04:11 -0500 Subject: Change refute to assert_not --- actioncable/test/channel/stream_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actioncable/test') diff --git a/actioncable/test/channel/stream_test.rb b/actioncable/test/channel/stream_test.rb index eca06fe365..52e1ad81de 100644 --- a/actioncable/test/channel/stream_test.rb +++ b/actioncable/test/channel/stream_test.rb @@ -167,7 +167,7 @@ module ActionCable::StreamTests @server.broadcast "channel", {} wait_for_async - refute Thread.current[:ran_callback], "User callback was not run through the worker pool" + assert_not Thread.current[:ran_callback], "User callback was not run through the worker pool" end end -- cgit v1.2.3 From 94333a4c31bd10c1f358c538a167e6a4589bae2d Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Thu, 25 Jan 2018 18:14:09 -0500 Subject: Use assert_predicate and assert_not_predicate --- actioncable/test/channel/base_test.rb | 6 +++--- actioncable/test/channel/stream_test.rb | 4 ++-- actioncable/test/client_test.rb | 2 +- actioncable/test/connection/base_test.rb | 6 +++--- actioncable/test/connection/subscriptions_test.rb | 6 +++--- actioncable/test/subscription_adapter/common.rb | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) (limited to 'actioncable/test') diff --git a/actioncable/test/channel/base_test.rb b/actioncable/test/channel/base_test.rb index 866bd7c21b..3b8eb63975 100644 --- a/actioncable/test/channel/base_test.rb +++ b/actioncable/test/channel/base_test.rb @@ -97,12 +97,12 @@ class ActionCable::Channel::BaseTest < ActiveSupport::TestCase @channel.subscribe_to_channel assert @channel.room - assert @channel.subscribed? + assert_predicate @channel, :subscribed? @channel.unsubscribe_from_channel - assert ! @channel.room - assert ! @channel.subscribed? + assert_not @channel.room + assert_not_predicate @channel, :subscribed? end test "connection identifiers" do diff --git a/actioncable/test/channel/stream_test.rb b/actioncable/test/channel/stream_test.rb index 52e1ad81de..e9e8849637 100644 --- a/actioncable/test/channel/stream_test.rb +++ b/actioncable/test/channel/stream_test.rb @@ -192,10 +192,10 @@ module ActionCable::StreamTests Connection.new(@server, env).tap do |connection| connection.process - assert connection.websocket.possible? + assert_predicate connection.websocket, :possible? wait_for_async - assert connection.websocket.alive? + assert_predicate connection.websocket, :alive? end end diff --git a/actioncable/test/client_test.rb b/actioncable/test/client_test.rb index 56b3ef143b..ec672a5828 100644 --- a/actioncable/test/client_test.rb +++ b/actioncable/test/client_test.rb @@ -307,7 +307,7 @@ class ClientTest < ActionCable::TestCase ActionCable.server.restart c.wait_for_close - assert c.closed? + assert_predicate c, :closed? end end end diff --git a/actioncable/test/connection/base_test.rb b/actioncable/test/connection/base_test.rb index 99488e38c8..c69d4d0b36 100644 --- a/actioncable/test/connection/base_test.rb +++ b/actioncable/test/connection/base_test.rb @@ -39,10 +39,10 @@ class ActionCable::Connection::BaseTest < ActionCable::TestCase connection = open_connection connection.process - assert connection.websocket.possible? + assert_predicate connection.websocket, :possible? wait_for_async - assert connection.websocket.alive? + assert_predicate connection.websocket, :alive? end end @@ -95,7 +95,7 @@ class ActionCable::Connection::BaseTest < ActionCable::TestCase statistics = connection.statistics - assert statistics[:identifier].blank? + assert_predicate statistics[:identifier], :blank? assert_kind_of Time, statistics[:started_at] assert_equal [], statistics[:subscriptions] end diff --git a/actioncable/test/connection/subscriptions_test.rb b/actioncable/test/connection/subscriptions_test.rb index 149a40604a..cc2f4a2938 100644 --- a/actioncable/test/connection/subscriptions_test.rb +++ b/actioncable/test/connection/subscriptions_test.rb @@ -45,7 +45,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase setup_connection @subscriptions.execute_command "command" => "subscribe" - assert @subscriptions.identifiers.empty? + assert_predicate @subscriptions.identifiers, :empty? end end @@ -58,7 +58,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase channel.expects(:unsubscribe_from_channel) @subscriptions.execute_command "command" => "unsubscribe", "identifier" => @chat_identifier - assert @subscriptions.identifiers.empty? + assert_predicate @subscriptions.identifiers, :empty? end end @@ -67,7 +67,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase setup_connection @subscriptions.execute_command "command" => "unsubscribe" - assert @subscriptions.identifiers.empty? + assert_predicate @subscriptions.identifiers, :empty? end end diff --git a/actioncable/test/subscription_adapter/common.rb b/actioncable/test/subscription_adapter/common.rb index c533a9f3eb..b3e9ae9d5c 100644 --- a/actioncable/test/subscription_adapter/common.rb +++ b/actioncable/test/subscription_adapter/common.rb @@ -32,7 +32,7 @@ module CommonSubscriptionAdapterTest subscribed = Concurrent::Event.new adapter.subscribe(channel, callback, Proc.new { subscribed.set }) subscribed.wait(WAIT_WHEN_EXPECTING_EVENT) - assert subscribed.set? + assert_predicate subscribed, :set? yield queue -- cgit v1.2.3 From 82c39e1a0b5114e2d89a80883a41090567a83196 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Thu, 25 Jan 2018 18:16:57 -0500 Subject: Use assert_empty and assert_not_empty --- actioncable/test/connection/subscriptions_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actioncable/test') diff --git a/actioncable/test/connection/subscriptions_test.rb b/actioncable/test/connection/subscriptions_test.rb index cc2f4a2938..3323785494 100644 --- a/actioncable/test/connection/subscriptions_test.rb +++ b/actioncable/test/connection/subscriptions_test.rb @@ -45,7 +45,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase setup_connection @subscriptions.execute_command "command" => "subscribe" - assert_predicate @subscriptions.identifiers, :empty? + assert_empty @subscriptions.identifiers end end @@ -58,7 +58,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase channel.expects(:unsubscribe_from_channel) @subscriptions.execute_command "command" => "unsubscribe", "identifier" => @chat_identifier - assert_predicate @subscriptions.identifiers, :empty? + assert_empty @subscriptions.identifiers end end @@ -67,7 +67,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase setup_connection @subscriptions.execute_command "command" => "unsubscribe" - assert_predicate @subscriptions.identifiers, :empty? + assert_empty @subscriptions.identifiers end end -- cgit v1.2.3