diff options
| author | Andres Ornelas Mesta | 2010-05-24 13:54:32 -0700 |
|---|---|---|
| committer | Andres Ornelas Mesta | 2010-05-24 13:54:32 -0700 |
| commit | f6c67e28c94033edf6a16eb6508de54679cb49db (patch) | |
| tree | 2789a523583eaf4aa1cb74e03a4a63ff5e046f05 /test | |
| parent | d485421e0e5d6c502e4f62de69d1b4b353f20bbd (diff) | |
| download | angular.js-f6c67e28c94033edf6a16eb6508de54679cb49db.tar.bz2 | |
happy
Diffstat (limited to 'test')
| -rw-r--r-- | test/jquery_alias.js | 1 | ||||
| -rw-r--r-- | test/jquery_remove.js | 1 | ||||
| -rw-r--r-- | test/scenario/RunnerSpec.js | 34 |
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 |
