Class: RubyEventStore::RSpec::CrudeFailureMessageFormatter::HaveApplied

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/rspec/crude_failure_message_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#differObject (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 failure_message(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 failure_message_when_negated(expected, events)
  "expected #{expected.events} not to be applied, diff:" + differ.diff(expected.events.inspect + "\n", events)
end