Skip to content

Instantly share code, notes, and snippets.

@judofyr
Forked from Mikoangelo/Screenshot
Created June 29, 2009 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judofyr/137543 to your computer and use it in GitHub Desktop.
Save judofyr/137543 to your computer and use it in GitHub Desktop.
// 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()
}
}
$ ./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