Created
September 21, 2009 08:00
-
-
Save petyosi/190127 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
function describe(description, block) { | |
$(document).ready(function() { | |
module(description); | |
block(); | |
}); | |
} | |
function the(what) { | |
return { | |
should : function(matcher) { | |
ok(matcher.against(what), matcher.positiveDescription()); | |
}, | |
shouldNot : function(matcher) { | |
ok(!matcher.against(what), matcher.negativeDescription()); | |
} | |
} | |
} | |
function it(description, block) { | |
test(description, block); | |
} | |
function equal(expected) { | |
return { | |
positiveDescription : function() { | |
return this.lastMatchedAgainst + " should equal " + expected; | |
}, | |
negativeDescription : function() { | |
return this.lastMatchedAgainst + " should not equal " + expected; | |
}, | |
against : function(obj) { | |
this.lastMatchedAgainst = obj; | |
return obj == expected; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment