Class: RubyEventStore::RSpec::BeEvent::FailureMessage
- Inherits:
-
Object
- Object
- RubyEventStore::RSpec::BeEvent::FailureMessage
- Defined in:
- lib/ruby_event_store/rspec/be_event.rb
Defined Under Namespace
Classes: ActualLine, Diff, ExpectedLine
Instance Method Summary collapse
-
#initialize(expected_klass, actual_klass, expected_data, actual_data, expected_metadata, actual_metadata, differ:, formatter:) ⇒ FailureMessage
constructor
A new instance of FailureMessage.
- #to_s ⇒ Object
Constructor Details
#initialize(expected_klass, actual_klass, expected_data, actual_data, expected_metadata, actual_metadata, differ:, formatter:) ⇒ FailureMessage
Returns a new instance of FailureMessage.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/ruby_event_store/rspec/be_event.rb', line 100 def initialize( expected_klass, actual_klass, expected_data, actual_data, , , differ:, formatter: ) @expected_klass = expected_klass @actual_klass = actual_klass @expected_data = expected_data @actual_data = actual_data = = @differ = differ @formatter = formatter end |
Instance Method Details
#to_s ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/ruby_event_store/rspec/be_event.rb', line 120 def to_s [ ExpectedLine.new(@expected_klass, , @expected_data, formatter: @formatter), ActualLine.new( @actual_klass, .to_h, @actual_data, , @expected_data, formatter: @formatter, ), Diff.new(.to_h, , "Metadata", differ: @differ, formatter: @formatter), Diff.new(@actual_data, @expected_data, "Data", differ: @differ, formatter: @formatter), ].map(&:to_s).join end |