Skip to content

Commit 64bd968

Browse files
committed
ObjectFormatter sorts hash keys
When spec example includes more keys, the ObjectFormatter actually has some work to do. This mandates its presensce for mutant, effectivelly killing mutations.
1 parent ebe98a5 commit 64bd968

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ruby_event_store-rspec/spec/ruby_event_store/rspec/be_event_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,27 @@ def formatter
9595
specify { expect(FooEvent.new(metadata: { baz: "bar" })).not_to matcher(FooEvent).with_metadata({ foo: "bar" }) }
9696

9797
specify do
98-
matcher_ = matcher(FooEvent).with_metadata({ foo: "bar" })
98+
matcher_ = matcher(FooEvent).with_metadata({ foo: "bar", baz: "bar" })
9999
matcher_.matches?(FooEvent.new)
100100
expect(matcher_.failure_message).to eq(
101101
"
102-
expected: FooEvent with metadata: #{formatter[foo: "bar"]}
102+
expected: FooEvent with metadata: #{formatter[foo: "bar", baz: "bar"]}
103103
got: FooEvent with metadata: {}
104104
105105
Metadata diff:
106106
@@ -1,2 +1,2 @@
107-
-#{formatter[foo: "bar"]}
107+
-#{formatter[foo: "bar", baz: "bar"]}
108108
+{}
109109
",
110110
)
111111
end
112112

113113
specify do
114-
matcher_ = matcher(FooEvent).with_data({ foo: "bar" }).with_metadata({ bar: "baz" })
114+
matcher_ = matcher(FooEvent).with_data({ foo: "bar", baz: "bar" }).with_metadata({ bar: "baz" })
115115
matcher_.matches?(FooEvent.new)
116116
expect(matcher_.failure_message).to eq(
117117
"
118-
expected: FooEvent with metadata: #{formatter[bar: "baz"]} data: #{formatter[foo: "bar"]}
118+
expected: FooEvent with metadata: #{formatter[bar: "baz"]} data: #{formatter[foo: "bar", baz: "bar"]}
119119
got: FooEvent with metadata: {} data: {}
120120
121121
Metadata diff:
@@ -125,29 +125,29 @@ def formatter
125125
126126
Data diff:
127127
@@ -1,2 +1,2 @@
128-
-#{formatter[foo: "bar"]}
128+
-#{formatter[foo: "bar", baz: "bar"]}
129129
+{}
130130
",
131131
)
132132
end
133133

134134
specify do
135135
matcher_ = matcher(FooEvent).with_data({ foo: "bar" }).with_metadata({ bar: "baz" })
136-
matcher_.matches?(FooEvent.new(data: { bar: "baz" }, metadata: { baz: "foo" }))
136+
matcher_.matches?(FooEvent.new(data: { baz: "bar", bar: "baz" }, metadata: { baz: "foo", bar: "foo" }))
137137
expect(matcher_.failure_message).to eq(
138138
"
139139
expected: FooEvent with metadata: #{formatter[bar: "baz"]} data: #{formatter[foo: "bar"]}
140-
got: FooEvent with metadata: #{formatter[baz: "foo"]} data: #{formatter[bar: "baz"]}
140+
got: FooEvent with metadata: #{formatter[baz: "foo", bar: "foo"]} data: #{formatter[baz: "bar", bar: "baz"]}
141141
142142
Metadata diff:
143143
@@ -1,2 +1,2 @@
144144
-#{formatter[bar: "baz"]}
145-
+#{formatter[baz: "foo"]}
145+
+#{formatter[baz: "foo", bar: "foo"]}
146146
147147
Data diff:
148148
@@ -1,2 +1,2 @@
149149
-#{formatter[foo: "bar"]}
150-
+#{formatter[bar: "baz"]}
150+
+#{formatter[baz: "bar", bar: "baz"]}
151151
",
152152
)
153153
end

0 commit comments

Comments
 (0)