Class: RosettaQueue::Matchers::PublishMessage
- Inherits:
-
PublishMessageMatcher
- Object
- PublishMessageMatcher
- RosettaQueue::Matchers::PublishMessage
- Defined in:
- lib/rosetta_queue/spec_helpers/publishing_matchers.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(expected_message, options) ⇒ PublishMessage
constructor
A new instance of PublishMessage.
- #matches?(lambda_to_run) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected_message, options) ⇒ PublishMessage
Returns a new instance of PublishMessage.
110 111 112 113 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 110 def initialize(, ) @expected_message = () end |
Instance Method Details
#description ⇒ Object
132 133 134 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 132 def description "publish the message: #{@expected_message.inspect}" end |
#failure_message ⇒ Object
120 121 122 123 124 125 126 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 120 def if @actual_message.blank? "expected #{@expected_message.inspect} to be published but no message was" else "expected #{@expected_message.inspect} to be published but the following was instead: #{@actual_message.inspect}" end end |
#matches?(lambda_to_run) ⇒ Boolean
115 116 117 118 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 115 def matches?(lambda_to_run) super @actual_message == @expected_message end |
#negative_failure_message ⇒ Object
128 129 130 |
# File 'lib/rosetta_queue/spec_helpers/publishing_matchers.rb', line 128 def "expected #{@expected_message.inspect} not to be published but it was" end |