@@ -25,14 +25,17 @@ class VerifyAllSpecification extends EmbeddedSpecification {
25
25
}
26
26
}""" )
27
27
then :
28
- result. failures. size() == 2
29
- with(result. failures[0 ]. exception, SpockComparisonFailure ) {
30
- expected. trim() == " 2"
31
- actual. trim() == " 1"
32
- }
33
- with(result. failures[1 ]. exception, SpockComparisonFailure ) {
34
- expected. trim() == " 4"
35
- actual. trim() == " 3"
28
+ result. failures. size() == 1
29
+ with(result. failures[0 ]. exception, MultipleFailuresError ) {
30
+ failures. size() == 2
31
+ with(failures[0 ], SpockComparisonFailure ) {
32
+ expected. stringRepresentation. trim() == " 2"
33
+ actual. stringRepresentation. trim() == " 1"
34
+ }
35
+ with(failures[1 ], SpockComparisonFailure ) {
36
+ expected. stringRepresentation. trim() == " 4"
37
+ actual. stringRepresentation. trim() == " 3"
38
+ }
36
39
}
37
40
}
38
41
@@ -79,16 +82,19 @@ class VerifyAllSpecification extends EmbeddedSpecification {
79
82
}
80
83
}""" )
81
84
then:
82
- result.failures.size() == 2
83
-
84
- with(result.failures[0].exception, SpockComparisonFailure) {
85
- expected.trim() == "3"
86
- actual.trim() == "2"
87
- }
88
- with(result.failures[1].exception, SpockComparisonFailure) {
89
- expected.trim() == "4"
90
- actual.trim() == "3"
85
+ result.failures.size() == 1
86
+ with(result.failures[0].exception, MultipleFailuresError) {
87
+ failures.size() == 2
88
+ with(failures[0], SpockComparisonFailure) {
89
+ expected.stringRepresentation.trim() == "3"
90
+ actual.stringRepresentation.trim() == "2"
91
+ }
92
+ with(failures[1], SpockComparisonFailure) {
93
+ expected.stringRepresentation.trim() == "4"
94
+ actual.stringRepresentation.trim() == "3"
95
+ }
91
96
}
97
+
92
98
}
93
99
94
100
def "verifyAll with target and failures"() {
@@ -108,14 +114,17 @@ class VerifyAllSpecification extends EmbeddedSpecification {
108
114
}
109
115
}""" )
110
116
then:
111
- result.failures.size() == 2
112
- with(result.failures[0].exception, SpockComparisonFailure) {
113
- expected.trim() == "Bob"
114
- actual.trim() == "Fred"
115
- }
116
- with(result.failures[1].exception, SpockComparisonFailure) {
117
- expected.trim() == "137"
118
- actual.trim() == "42"
117
+ result.failures.size() == 1
118
+ with(result.failures[0].exception, MultipleFailuresError) {
119
+ failures.size() == 2
120
+ with(failures[0], SpockComparisonFailure) {
121
+ expected.stringRepresentation.trim() == "Bob"
122
+ actual.stringRepresentation.trim() == "Fred"
123
+ }
124
+ with(failures[1], SpockComparisonFailure) {
125
+ expected.stringRepresentation.trim() == "137"
126
+ actual.stringRepresentation.trim() == "42"
127
+ }
119
128
}
120
129
}
121
130
@@ -148,14 +157,18 @@ class VerifyAllSpecification extends EmbeddedSpecification {
148
157
}
149
158
}""" )
150
159
then:
151
- result.failures.size() == 2
152
- with(result.failures[0].exception, SpockComparisonFailure) {
153
- expected.trim() == "Bob"
154
- actual.trim() == "Fred"
155
- }
156
- with(result.failures[1].exception, SpockComparisonFailure) {
157
- expected.trim() == "137"
158
- actual.trim() == "42"
160
+
161
+ result.failures.size() == 1
162
+ with(result.failures[0].exception, MultipleFailuresError) {
163
+ failures.size() == 2
164
+ with(failures[0], SpockComparisonFailure) {
165
+ expected.stringRepresentation.trim() == "Bob"
166
+ actual.stringRepresentation.trim() == "Fred"
167
+ }
168
+ with(failures[1], SpockComparisonFailure) {
169
+ expected.stringRepresentation.trim() == "137"
170
+ actual.stringRepresentation.trim() == "42"
171
+ }
159
172
}
160
173
}
161
174
@@ -319,18 +332,22 @@ class VerifyAllSpecification extends EmbeddedSpecification {
319
332
}
320
333
}""" )
321
334
then:
322
- result.failures.size() == 3
323
- with(result.failures[0].exception, SpockComparisonFailure) {
324
- expected.trim() == "2"
325
- actual.trim() == "1"
326
- }
327
- with(result.failures[1].exception, SpockComparisonFailure) {
328
- expected.trim() == "4"
329
- actual.trim() == "3"
330
- }
331
- with(result.failures[2].exception, SpockComparisonFailure) {
332
- expected.trim() == "5"
333
- actual.trim() == "4"
335
+
336
+ result.failures.size() == 1
337
+ with(result.failures[0].exception, MultipleFailuresError) {
338
+ failures.size() == 3
339
+ with(failures[0], SpockComparisonFailure) {
340
+ expected.stringRepresentation.trim() == "2"
341
+ actual.stringRepresentation.trim() == "1"
342
+ }
343
+ with(failures[1], SpockComparisonFailure) {
344
+ expected.stringRepresentation.trim() == "4"
345
+ actual.stringRepresentation.trim() == "3"
346
+ }
347
+ with(failures[2], SpockComparisonFailure) {
348
+ expected.stringRepresentation.trim() == "5"
349
+ actual.stringRepresentation.trim() == "4"
350
+ }
334
351
}
335
352
}
336
353
0 commit comments