-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use an error constant for "nil client" errors (#90)
* Define a constant error for nil clients & return that This should allow tests and other code that relied on some predictable behavior on nil client usage to still receive that behavior: Instead of `nil`, we just return ErrNoClient now. * Add a test case for ErrNoClient behavior * Add four methods not covered by the test * Incr, Decr * Timing, TimeInMilliseconds * Remove TestNilSafe in favor of TestNilError By using assertNotPanics in the test case, we can assert that it doesn't panic just as well, and it doesn't require maintaining the same list of function calls in two tests.
- Loading branch information
1 parent
c31b787
commit f6e7675
Showing
2 changed files
with
43 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters