Skip to content

Instantly share code, notes, and snippets.

@jcbozonier
Created October 25, 2009 08:22
Show Gist options
  • Save jcbozonier/217958 to your computer and use it in GitHub Desktop.
Save jcbozonier/217958 to your computer and use it in GitHub Desktop.
when
[
"I add two numbers" : [{
ItShould : "sum them",
Means : function () { this.result.shouldEqual(this.num1 + this.num2);},{
ItShould : "sum them",
Means : function () { this.result.shouldEqual(this.num1 + this.num2);}],
"I make unf" :[{
ItShould : "unf them",
Means : function () { this.result.shouldEqual(this.num1 + this.num2);},{
ItShould : "make unf to them",
Means : function () { this.result.shouldEqual(this.num1 + this.num2);}]
]
when("I Add two numbers")
.itShould("sum them")
.means(function () { this.result.shouldEqual(this.num1 + this.num2); })
.itShould("not subtract them")
.means(function () { this.result.shouldNotBeSubtracted(); });
var they_are_summed = function () { this.result.shouldEqual(this.num1 + this.num2); }
var they_are_not_subtracted = function () { this.result.shouldNotBeSubtracted(); }
when("I Add two numbers")
.itShould("sum them").means(they_are_summed)
.itShould("not subtract them").means(they_are_not_subtracted);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment