Class: RosettaQueue::Matchers::PublishMessageMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rosetta_queue/spec_helpers/publishing_matchers.rb

Direct Known Subclasses

PublishMessage, PublishMessageWith

Instance Method Summary collapse

Instance Method Details

#matches?(lambda_to_run) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
63
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 55

def matches?(lambda_to_run)
  #given
  RosettaQueue::Adapter.stub!(:instance).and_return(fake_adapter = RosettaQueue::Gateway::FakeAdapter.new)
  #when
  lambda_to_run.call
  #then
  message = fake_adapter.messages_sent_to(@expected_queue).first || ''
  @actual_message = message
end