-
-
Save judofyr/137543 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
// This would be sweet Miko: | |
// Go Object.property! | |
Speck.describe("your mother") { | |
it.should("be true") { | |
true.should = true | |
} | |
it.should("not be false") { | |
false.should_not = true | |
} | |
} | |
Speck.describe("the wrong mother") { | |
it.should("not be true") { | |
true.should_not = true | |
} | |
} | |
Speck.describe("an exceptional mother") { | |
it.should("gently lob") { | |
{ | |
throw(#cantaloupe) | |
}.should.throw() | |
} | |
it.should("not throw defaultily") { | |
throw("OH SNAP") | |
} | |
it.should("but doesn't") { | |
{}.should.throw() | |
} | |
} |
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
$ ./speck.sn | |
Loading specs from examples/array.sn | |
Describing your mother | |
Spec on #<Describer subject:your mother>: it should be true | |
Spec on #<Describer subject:your mother>: it should not be false | |
Describing the wrong mother | |
Spec on #<Describer subject:the wrong mother>: it should not be true | |
Describing an exceptional mother | |
Spec on #<Describer subject:an exceptional mother>: it should gently lob | |
Spec on #<Describer subject:an exceptional mother>: it shouldn’t throw defaultily | |
Spec on #<Describer subject:an exceptional mother>: it should, but doesn't | |
Gonna run them now. | |
your mother should be true: success | |
your mother should not be false: success | |
the wrong mother should not be true: failure | |
an exceptional mother should gently lob: success | |
an exceptional mother shouldn’t throw defaultily: failure | |
an exceptional mother should, but doesn't: failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment