2012-01-11 19:30:10 +00:00
|
|
|
class jasmine.GWT.Background
|
2012-01-18 22:41:08 +00:00
|
|
|
constructor: (@code) ->
|
2012-01-11 19:30:10 +00:00
|
|
|
@statements = []
|
|
|
|
|
2012-01-18 22:41:08 +00:00
|
|
|
run: =>
|
2012-01-11 19:30:10 +00:00
|
|
|
jasmine.GWT.currentScenario_ = this
|
|
|
|
|
2012-01-18 22:41:08 +00:00
|
|
|
@code.apply(this)
|
2012-01-11 19:30:10 +00:00
|
|
|
|
|
|
|
jasmine.GWT.currentScenario_ = null
|
|
|
|
|
2012-01-18 22:41:08 +00:00
|
|
|
Given: (name, code) => this.Step('Given', name, code)
|
|
|
|
When: (name, code) => this.Step('When', name, code)
|
|
|
|
Then: (name, code) => this.Step('Then', name, code)
|
|
|
|
|
|
|
|
Step: (type, name, code) =>
|
|
|
|
@statements.push([ type, name, code ])
|
2012-01-11 19:30:10 +00:00
|
|
|
|