jasmine-gwt/lib/assets/javascripts/jasmine/GWT/Background.js.coffee

19 lines
431 B
CoffeeScript
Raw Normal View History

2012-01-11 19:30:10 +00:00
class jasmine.GWT.Background
constructor: (@code) ->
2012-01-11 19:30:10 +00:00
@statements = []
run: =>
2012-01-11 19:30:10 +00:00
jasmine.GWT.currentScenario_ = this
@code.apply(this)
2012-01-11 19:30:10 +00:00
jasmine.GWT.currentScenario_ = null
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