Skip to content

Commit

Permalink
chore(pubsub): Update minitest to 5.14
Browse files Browse the repository at this point in the history
* Add rubocop-minitest
* Run bundle exec rubocop --only Minitest/GlobalExpectations -a
* Revert rubocop-minitest

refs: #4110
refs: #4116
pr:  #5585
  • Loading branch information
quartzmo authored Apr 21, 2020
1 parent 5045b91 commit b4843d1
Show file tree
Hide file tree
Showing 51 changed files with 1,427 additions and 1,423 deletions.
4 changes: 0 additions & 4 deletions google-cloud-pubsub/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ gem "google-cloud-errors", path: "../google-cloud-errors"

gem "minitest-reporters", "~> 1.3.5", require: false
gem "rake"

# Pin minitest to 5.11.x to avoid warnings emitted by 5.12.
# See https://github.com/googleapis/google-cloud-ruby/issues/4110
gem "minitest", "~> 5.11.3"
18 changes: 9 additions & 9 deletions google-cloud-pubsub/acceptance/pubsub/async_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def retrieve_subscription topic, subscription_name

it "publishes and pulls asyncronously" do
events = sub.pull
events.must_be :empty?
_(events).must_be :empty?
# Publish a new message
publish_result = nil
topic.publish_async "hello" do |result|
Expand All @@ -45,8 +45,8 @@ def retrieve_subscription topic, subscription_name
puts "the async publish has not completed yet. sleeping for #{unpublished_retries*unpublished_retries} second(s) and retrying."
sleep unpublished_retries*unpublished_retries
end
publish_result.wont_be :nil?
publish_result.must_be :succeeded?
_(publish_result).wont_be :nil?
_(publish_result).must_be :succeeded?

received_message = nil
subscriber = sub.listen do |msg|
Expand All @@ -63,8 +63,8 @@ def retrieve_subscription topic, subscription_name
puts "received_message has not been received. sleeping for #{subscription_retries} second(s) and retrying."
sleep subscription_retries
end
received_message.wont_be :nil?
received_message.data.must_equal publish_result.data
_(received_message).wont_be :nil?
_(received_message.data).must_equal publish_result.data

subscriber.stop
subscriber.wait!
Expand All @@ -82,7 +82,7 @@ def retrieve_subscription topic, subscription_name
assert sub.message_ordering?

events = sub.pull
events.must_be :empty?
_(events).must_be :empty?

# Publish a new message
publish_result = nil
Expand Down Expand Up @@ -112,8 +112,8 @@ def retrieve_subscription topic, subscription_name
puts "the async publish has not completed yet. sleeping for #{unpublished_retries*unpublished_retries} second(s) and retrying."
sleep unpublished_retries*unpublished_retries
end
publish_result.wont_be :nil?
publish_result.must_be :succeeded?
_(publish_result).wont_be :nil?
_(publish_result).must_be :succeeded?

received_message_hash = Hash.new { |hash, key| hash[key] = [] }
subscriber = sub.listen do |msg|
Expand Down Expand Up @@ -147,7 +147,7 @@ def retrieve_subscription topic, subscription_name
"ordered message 9"
]
}
received_message_hash.must_equal expected_message_hash
_(received_message_hash).must_equal expected_message_hash

subscriber.stop
subscriber.wait!
Expand Down
Loading

0 comments on commit b4843d1

Please sign in to comment.