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

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

Defined Under Namespace

Classes: ActualLine, Diff, ExpectedLine

Instance Method Summary collapse

Constructor Details

#initialize(expected_klass, actual_klass, expected_data, actual_data, expected_metadata, actual_metadata, differ:) ⇒ FailureMessage

Returns a new instance of FailureMessage.


97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/ruby_event_store/rspec/be_event.rb', line 97

def initialize(
  expected_klass,
  actual_klass,
  expected_data,
  actual_data,
  ,
  ,
  differ:
)
  @expected_klass = expected_klass
  @actual_klass = actual_klass
  @expected_data = expected_data
  @actual_data = actual_data
  @expected_metadata = 
  @actual_metadata = 
  @differ = differ
end

Instance Method Details

#to_sObject


115
116
117
118
119
120
121
122
# File 'lib/ruby_event_store/rspec/be_event.rb', line 115

def to_s
  [
    ExpectedLine.new(@expected_klass, @expected_metadata, @expected_data),
    ActualLine.new(@actual_klass, @actual_metadata.to_h, @actual_data, @expected_metadata, @expected_data),
    Diff.new(@actual_metadata.to_h, @expected_metadata, "Metadata", differ: @differ),
    Diff.new(@actual_data, @expected_data, "Data", differ: @differ)
  ].map(&:to_s).join
end