Class: RosettaQueue::Matchers::PublishMessageWith
- Inherits:
-
PublishMessageMatcher
- Object
- PublishMessageMatcher
- RosettaQueue::Matchers::PublishMessageWith
- Defined in:
- lib/rosetta_queue/spec_helpers/publishing_matchers.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(message_subset, options) ⇒ PublishMessageWith
constructor
A new instance of PublishMessageWith.
- #matches?(lambda_to_run) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(message_subset, options) ⇒ PublishMessageWith
Returns a new instance of PublishMessageWith.
75 76 77 78 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 75 def initialize(, ) @message_subset = () end |
Instance Method Details
#description ⇒ Object
97 98 99 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 97 def description "publish a message with #{@message_subset.inspect}" end |
#failure_message ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 85 def if @actual_message.blank? "expected #{@message_subset.inspect} to be contained in a message but no message was published" else "expected #{@message_subset.inspect} to be contained in the message: #{@actual_message.inspect}" end end |
#matches?(lambda_to_run) ⇒ Boolean
80 81 82 83 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 80 def matches?(lambda_to_run) super Spec::Mocks::ArgumentConstraints::HashIncludingConstraint.new(@message_subset) == @actual_message end |
#negative_failure_message ⇒ Object
93 94 95 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 93 def "expected #{@message_subset.inspect} not to be contained in the message but was" end |