Skip to content

Commit

Permalink
Fix README so it doesn't talk about XCTest "bug"
Browse files Browse the repository at this point in the history
It's not a bug. It's the design.
  • Loading branch information
jonreid committed Aug 12, 2017
1 parent 010b446 commit a292fd8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ deallocated so that the swizzling is undone.

In the example above, `mockUserDefaultsClass` will go out scope and be
destroyed. But what if you kept it in the test fixture, as an ivar or a
property? Due to a bug in XCTest, it won't be implicitly destroyed. You need to
explicitly set it to nil in `-tearDown`, or the swizzling will bleed over to
your other tests, compromising their integrity.
property? According to XCTest's design, it won't be implicitly destroyed.
You need to explicitly set it to nil in `-tearDown`, or the swizzling will
bleed over to your other tests, compromising their integrity.

If you need more control over when the swizzling is undone, call
`stopMocking(…)` on the mock class.
Expand Down

0 comments on commit a292fd8

Please sign in to comment.