Class: RubyEventStore::RSpec::CrudeFailureMessageFormatter::HavePublished
- Inherits:
-
Object
- Object
- RubyEventStore::RSpec::CrudeFailureMessageFormatter::HavePublished
- Defined in:
- lib/ruby_event_store/rspec/crude_failure_message_formatter.rb
Instance Method Summary collapse
- #failure_message(expected, events, stream_name) ⇒ Object
- #failure_message_when_negated(expected, events, stream_name) ⇒ Object
-
#initialize(differ) ⇒ HavePublished
constructor
A new instance of HavePublished.
Constructor Details
#initialize(differ) ⇒ HavePublished
Returns a new instance of HavePublished.
7 8 9 |
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 7 def initialize(differ) @differ = differ end |
Instance Method Details
#failure_message(expected, events, stream_name) ⇒ Object
11 12 13 14 15 |
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 11 def (expected, events, stream_name) stream_expectation = " in stream #{stream_name}" unless stream_name.nil? "expected #{expected.events} to be published#{stream_expectation}, diff:" + differ.diff(expected.events.to_s + "\n", events) end |
#failure_message_when_negated(expected, events, stream_name) ⇒ Object
17 18 19 20 21 |
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 17 def (expected, events, stream_name) stream_expectation = " in stream #{stream_name}" unless stream_name.nil? "expected #{expected.events} not to be published#{stream_expectation}, diff:" + differ.diff(expected.events.to_s + "\n", events) end |