aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/jquery_alias.js1
-rw-r--r--test/jquery_remove.js1
-rw-r--r--test/scenario/RunnerSpec.js34
3 files changed, 33 insertions, 3 deletions
diff --git a/test/jquery_alias.js b/test/jquery_alias.js
new file mode 100644
index 00000000..4b3fad00
--- /dev/null
+++ b/test/jquery_alias.js
@@ -0,0 +1 @@
+var _jQuery = jQuery; \ No newline at end of file
diff --git a/test/jquery_remove.js b/test/jquery_remove.js
new file mode 100644
index 00000000..5283c340
--- /dev/null
+++ b/test/jquery_remove.js
@@ -0,0 +1 @@
+var _jQuery = jQuery.noConflict(true); \ No newline at end of file
diff --git a/test/scenario/RunnerSpec.js b/test/scenario/RunnerSpec.js
index 2883ab7c..702e1ab5 100644
--- a/test/scenario/RunnerSpec.js
+++ b/test/scenario/RunnerSpec.js
@@ -1,14 +1,18 @@
describe('Runner', function(){
- var scenario, runner, log, Describe, It, $scenario;
+ var scenario, runner, log, Describe, It, $scenario, body;
function logger(text) {
- return function(){log += text;};
+ return function(done){
+ log += text;
+ (done||noop)();
+ };
}
beforeEach(function(){
log = '';
scenario = {};
- runner = new angular.scenario.Runner(scenario);
+ body = _jQuery('<div></div>');
+ runner = new angular.scenario.Runner(scenario, _jQuery);
Describe = scenario.describe;
It = scenario.it;
$scenario = scenario.$scenario;
@@ -105,4 +109,28 @@ describe('Runner', function(){
});
});
+ describe('run', function(){
+ var next;
+ it('should execute all specs', function(){
+ Describe('d1', function(){
+ It('it1', function(){ $scenario.addStep('s1', logger('s1,')); });
+ It('it2', function(){
+ $scenario.addStep('s2', logger('s2,'));
+ $scenario.addStep('s2.2', function(done){ next = done; });
+ });
+ });
+ Describe('d2', function(){
+ It('it3', function(){ $scenario.addStep('s3', logger('s3,')); });
+ It('it4', function(){ $scenario.addStep('s4', logger('s4,')); });
+ });
+
+ $scenario.run(body);
+
+ expect(log).toEqual('s1,s2,');
+ next();
+ expect(log).toEqual('s1,s2,s3,s4,');
+
+ });
+ });
+
}); \ No newline at end of file