forked from osteele/jsspec
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
git-svn-id: http://jsspec.googlecode.com/svn/trunk@96 92187c49-0d35-0…
…410-b305-2f54cc65526e
- Loading branch information
jania902
committed
Jan 11, 2008
1 parent
1e1f8c9
commit 420c8f0
Showing
4 changed files
with
115 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
load("/prj/jsspec/exp/src/JSSpec2.js") | ||
|
||
with(JSSpec2) { | ||
__log__ = []; | ||
|
||
given({"new scenario": function() { | ||
this.scenario = new JSSpec2.Scenario("Scenario 1") | ||
this.scenario.givens = { | ||
"Given 1": function() { | ||
__log__.push("given") | ||
this.a = 1 | ||
} | ||
} | ||
this.scenario.events = { | ||
"When 1": function() { | ||
__log__.push("when") | ||
this.b = 2 | ||
} | ||
} | ||
this.scenario.outcomes = { | ||
"Then 1": function() { | ||
__log__.push("then") | ||
this.c = 3 | ||
} | ||
} | ||
} | ||
}) | ||
|
||
when({ | ||
"the scenario runned": function() { | ||
this.scenario.run() | ||
} | ||
}) | ||
|
||
then({ | ||
"'given', 'when' and 'then' should be executed in exact order": function() { | ||
value_of(__log__.join(",")).should_be("given,when,then") | ||
}, | ||
"context should be preserved": function() { | ||
value_of(this.scenario.context.a).should_be(1); | ||
value_of(this.scenario.context.b).should_be(2); | ||
value_of(this.scenario.context.c).should_be(3); | ||
} | ||
}) | ||
} | ||
|
||
runner.run() |
This file was deleted.
Oops, something went wrong.