Class: RubyEventStore::RSpec::CrudeFailureMessageFormatter::Apply

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

Instance Method Summary collapse

Instance Method Details

#failure_message(expected, applied_events) ⇒ Object


79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 79

def failure_message(expected, applied_events)
  if !expected.empty?
    <<~EOS
    expected block to have applied:

    #{expected.events}

    but applied:

    #{applied_events}
    EOS
  else
    "expected block to have applied any events"
  end
end

#failure_message_when_negated(expected, applied_events) ⇒ Object


95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/ruby_event_store/rspec/crude_failure_message_formatter.rb', line 95

def failure_message_when_negated(expected, applied_events)
  if !expected.empty?
    <<~EOS
    expected block not to have applied:

    #{expected.events}

    but applied:

    #{applied_events}
    EOS
  else
    "expected block not to have applied any events"
  end
end