Last active
July 21, 2016 09:45
-
-
Save imbaker/5a5409fd5a991271d83454aec1c70046 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
customMatchers = | |
toBeLowerCase: (util) -> | |
return compare: (actual) -> | |
result = new Object | |
result.pass = util.equals(actual, actual.toLowerCase()) | |
result.message = if result.pass then "okay" else "Expected '" + actual + "' to be lower case" | |
return result | |
describe "customMatchers", () -> | |
beforeEach () -> | |
jasmine.addMatchers customMatchers | |
it "simple pass", () -> | |
expect("ab").toBeLowerCase() | |
it "simple fail", () -> | |
expect("AB").toBeLowerCase() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment