Class: RubyEventStore::RSpec::CrudeFailureMessageFormatter::HaveApplied
- Inherits:
-
Object
- Object
- RubyEventStore::RSpec::CrudeFailureMessageFormatter::HaveApplied
- Defined in:
- lib/ruby_event_store/rspec/crude_failure_message_formatter.rb
Instance Attribute Summary collapse
-
#differ ⇒ Object
readonly
Returns the value of attribute differ.
Instance Method Summary collapse
- #failure_message(expected, events) ⇒ Object
- #failure_message_when_negated(expected, events) ⇒ Object
-
#initialize(differ) ⇒ HaveApplied
constructor
A new instance of HaveApplied.
Constructor Details
#initialize(differ) ⇒ HaveApplied
Returns a new instance of HaveApplied.
63 64 65 |
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 63 def initialize(differ) @differ = differ end |
Instance Attribute Details
#differ ⇒ Object (readonly)
Returns the value of attribute differ.
75 76 77 |
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 75 def differ @differ end |
Instance Method Details
#failure_message(expected, events) ⇒ Object
67 68 69 |
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 67 def (expected, events) "expected #{expected.events} to be applied, diff:" + differ.diff(expected.events.to_s + "\n", events) end |
#failure_message_when_negated(expected, events) ⇒ Object
71 72 73 |
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 71 def (expected, events) "expected #{expected.events} not to be applied, diff:" + differ.diff(expected.events.inspect + "\n", events) end |