Skip to content

Commit

Permalink
Checking single message when multiple were received still wasn't work…
Browse files Browse the repository at this point in the history
…ing as expected.
  • Loading branch information
Gordon Craig committed Sep 14, 2017
1 parent 66d8ea1 commit a086f41
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .idea/dictionaries/craigg1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vagrant.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gemspec

gem ENV['CONCURRENCY'], require: false if ENV.key?('CONCURRENCY')
gem 'giphy', require: false if ENV.key?('WITH_GIPHY')
gem 'celluloid-io'

group :test do
gem 'slack-ruby-danger', '~> 0.1.0', require: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

allow(Giphy).to receive(:random) if defined?(Giphy)

allow(client).to receive(:message)
message_command.call(client, Hashie::Mash.new(text: message, channel: channel, user: user))
if expected.is_a? Array
expected.each do |exp|
expect(client).to receive(:message).with(channel: channel, text: exp)
expect(client).to have_received(:message).with(channel: channel, text: exp).at_least(:once)
end
else
expect(client).to receive(:message).with(channel: channel, text: expected).at_least(:once)
expect(client).to have_received(:message).with(channel: channel, text: expected)
end
message_command.call(client, Hashie::Mash.new(text: message, channel: channel, user: user))
true
end

Expand Down

0 comments on commit a086f41

Please sign in to comment.