Skip to content

Commit d73692d

Browse files
author
ikesyo
committed
[README] Use expect with trailing closure syntax for the succeed matcher
1 parent 1926019 commit d73692d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,22 +1239,22 @@ Note: This matcher allows you to chain any number of matchers together. This pro
12391239
// Swift
12401240
12411241
// passes if .succeeded is returned from the closure
1242-
expect({
1242+
expect {
12431243
guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else {
12441244
return .failed(reason: "wrong enum case")
12451245
}
12461246
12471247
return .succeeded
1248-
}).to(succeed())
1248+
}.to(succeed())
12491249
12501250
// passes if .failed is returned from the closure
1251-
expect({
1251+
expect {
12521252
guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else {
12531253
return .failed(reason: "wrong enum case")
12541254
}
12551255
12561256
return .succeeded
1257-
}).notTo(succeed())
1257+
}.notTo(succeed())
12581258
```
12591259

12601260
The `String` provided with `.failed()` is shown when the test fails.

0 commit comments

Comments
 (0)