Class: RubyEventStore::RSpec::BeEvent::FailureMessage::Diff

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

Instance Method Summary collapse

Constructor Details

#initialize(actual, expected, label, differ:) ⇒ Diff

Returns a new instance of Diff.


85
86
87
88
89
90
# File 'lib/ruby_event_store/rspec/be_event.rb', line 85

def initialize(actual, expected, label, differ:)
  @actual = actual
  @expected = expected
  @label = label
  @differ = differ
end

Instance Method Details

#to_sObject


92
93
94
# File 'lib/ruby_event_store/rspec/be_event.rb', line 92

def to_s
  @expected && ["\n#{@label} diff:", @differ.diff(@actual.to_s + "\n", @expected.to_s)]
end