diff options
| -rw-r--r-- | jsTestDriver.conf | 2 | ||||
| -rw-r--r-- | src/scenario/Matcher.js | 2 | ||||
| -rw-r--r-- | test/scenario/MatcherSpec.js | 8 | ||||
| -rw-r--r-- | test/testabilityPatch.js | 15 |
4 files changed, 19 insertions, 8 deletions
diff --git a/jsTestDriver.conf b/jsTestDriver.conf index bcd01694..c7d74b75 100644 --- a/jsTestDriver.conf +++ b/jsTestDriver.conf @@ -8,9 +8,9 @@ load: - src/Angular.js - src/JSON.js - src/*.js + - test/testabilityPatch.js - src/scenario/Runner.js - src/scenario/*.js - - test/testabilityPatch.js - test/angular-mocks.js - test/scenario/*.js - test/*.js diff --git a/src/scenario/Matcher.js b/src/scenario/Matcher.js index 62f094c8..a9c86571 100644 --- a/src/scenario/Matcher.js +++ b/src/scenario/Matcher.js @@ -18,4 +18,4 @@ Matcher.addMatcher = function(name, matcher) { }; }; -Matcher.addMatcher('toEqual', function(a,b) { return a == b; }); +Matcher.addMatcher('toEqual', angular.equals); diff --git a/test/scenario/MatcherSpec.js b/test/scenario/MatcherSpec.js index c47f0c25..2eddd2bc 100644 --- a/test/scenario/MatcherSpec.js +++ b/test/scenario/MatcherSpec.js @@ -27,4 +27,12 @@ describe('Matcher', function () { 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 diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 5d0df780..e9a88b67 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -35,22 +35,25 @@ function childNode(element, index) { } extend(angular, { - 'bind': bind, + 'element': jqLite, 'compile': compile, + 'scope': createScope, 'copy': copy, - 'element': jqLite, 'extend': extend, + 'equals': equals, 'foreach': foreach, + 'noop':noop, + 'bind':bind, + 'toJson': toJson, + 'fromJson': fromJson, 'identity':identity, 'isUndefined': isUndefined, 'isDefined': isDefined, - 'isObject': isObject, 'isString': isString, 'isFunction': isFunction, + 'isObject': isObject, 'isNumber': isNumber, - 'isArray': isArray, - 'noop':noop, - 'scope': createScope + 'isArray': isArray }); |
