forked from gmoeck/jasmine-sproutcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jasmine-integration-helpers.js
36 lines (33 loc) · 1.28 KB
/
jasmine-integration-helpers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if(typeof(setupApplication) === undefined){
setupApplication = function() {
};
}
var Scenario = function(description, specDefinitions) {
return jasmine.getEnv().Scenario(description, function() {
setupApplication();
specDefinitions();
});
};
var Given = function(description, specDefinitions) {
return jasmine.getEnv().Given(description, specDefinitions);
};
var When = function(description, specDefinitions) {
return jasmine.getEnv().When(description, specDefinitions);
};
var And = function(description, specDefinitions) {
return jasmine.getEnv().And(description, specDefinitions);
};
var Then = function(description, specDefinitions) {
return jasmine.getEnv().Then(description, function() {
specDefinitions(JasmineSproutcore.Page.create({selector: 'body'}));
});
};
var context = function(description, specDefinitions) {
return jasmine.getEnv().context(description, specDefinitions);
};
jasmine.Env.prototype.Scenario = jasmine.Env.prototype.describe;
jasmine.Env.prototype.Given = jasmine.Env.prototype.describe;
jasmine.Env.prototype.When = jasmine.Env.prototype.describe;
jasmine.Env.prototype.And = jasmine.Env.prototype.describe;
jasmine.Env.prototype.Then = jasmine.Env.prototype.it;
jasmine.Env.prototype.context = jasmine.Env.prototype.describe;