diff options
| author | Elliott Sprehn | 2010-10-08 16:43:40 -0700 |
|---|---|---|
| committer | Elliott Sprehn | 2010-10-14 09:47:39 -0700 |
| commit | 03df6cbddbb80186caf571e29957370b2ef9881c (patch) | |
| tree | d5a321c8b207b464a5c8a300c422186e20e8ae31 /test/scenario/MatcherSpec.js | |
| parent | 0f104317dff5628765e26cc68df7dd1175b2aa5e (diff) | |
| download | angular.js-03df6cbddbb80186caf571e29957370b2ef9881c.tar.bz2 | |
New Angular Scenario runner and DSL system with redesigned HTML UI.
Uses the Jasmine syntax for tests, ex:
describe('widgets', function() {
it('should verify that basic widgets work', function(){
navigateTo('widgets.html');
input('text.basic').enter('Carlos');
expect(binding('text.basic')).toEqual('Carlos');
input('text.basic').enter('Carlos Santana');
expect(binding('text.basic')).not().toEqual('Carlos Boozer');
input('text.password').enter('secret');
expect(binding('text.password')).toEqual('secret');
expect(binding('text.hidden')).toEqual('hiddenValue');
expect(binding('gender')).toEqual('male');
input('gender').select('female');
expect(binding('gender')).toEqual('female');
});
});
Note: To create new UI's implement the interface shown in angular.scenario.ui.Html.
Diffstat (limited to 'test/scenario/MatcherSpec.js')
| -rw-r--r-- | test/scenario/MatcherSpec.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/test/scenario/MatcherSpec.js b/test/scenario/MatcherSpec.js deleted file mode 100644 index 2eddd2bc..00000000 --- a/test/scenario/MatcherSpec.js +++ /dev/null @@ -1,38 +0,0 @@ -describe('Matcher', function () { - function executeFutures() { - for(var i in $scenario.currentSpec.futures) { - var future = $scenario.currentSpec.futures[i]; - future.behavior.call({}, function(value) { future.fulfill(value); }); - } - } - var matcher; - beforeEach(function() { - setUpContext(); - var future = $scenario.addFuture('Calculate first future', function(done) { - done(123); - }); - matcher = new Matcher(this, future); - - }); - it('should correctly match toEqual', function() { - matcher.toEqual(123); - executeFutures(); - }); - it('should throw an error when incorrect match toEqual', function() { - matcher.toEqual(456); - try { - executeFutures(); - fail(); - } catch (e) { - expect(e).toEqual('Expected 456 but was 123'); - } - }); - it('should correctly match arrays', function() { - var future = $scenario.addFuture('Calculate first future', function(done) { - done(['a', 'b']); - }); - matcher = new Matcher(this, future); - matcher.toEqual(['a', 'b']); - executeFutures(); - }); -});
\ No newline at end of file |
