Skip to content

Commit

Permalink
Merge pull request #3 from neonichu/master
Browse files Browse the repository at this point in the history
Fix typos in README
  • Loading branch information
mrackwitz committed Oct 6, 2015
2 parents 2477c4f + aaf9b32 commit 38a90bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ CatchingFire is a Swift test framework, which helps making expectations against

## Usage

### AssertNotThrow
### AssertNoThrow

`AssertNotThrow` allows you to write safe tests for the happy path of failable functions.
`AssertNoThrow` allows you to write safe tests for the happy path of failable functions.
It helps you to avoid the `try!` operator in tests.

If you want to test a function, which may fail in general, you may think of using `try`.
Expand All @@ -28,15 +28,15 @@ which is very undesirable, especially on CI, but also for your workflow when you
Instead you can write now:

```swift
AssertNotThrow {
AssertNoThrow {
XCTAssertEqual(try fib(x), 21)
}
```

Or alternatively:

```swift
AssertNotThrow(try fib(x)).map { (y: Int) in
AssertNoThrow(try fib(x)).map { (y: Int) in
XCTAssertEqual(y, 21)
}
```
Expand Down

0 comments on commit 38a90bf

Please sign in to comment.