From f9d73761bb0eaf5a38d522c7d5b0557efc693cd1 Mon Sep 17 00:00:00 2001 From: ragaskar Date: Fri, 30 Oct 2009 19:29:19 -0700 Subject: [PATCH] Restore Matcher prototype methods for IDE joy --- doc/files.html | 2 +- doc/index.html | 2 +- doc/symbols/_global_.html | 2 +- doc/symbols/jasmine.Block.html | 2 +- doc/symbols/jasmine.Env.html | 2 +- doc/symbols/jasmine.JsApiReporter.html | 2 +- doc/symbols/jasmine.Matchers.html | 2 +- doc/symbols/jasmine.MultiReporter.html | 2 +- doc/symbols/jasmine.NestedResults.html | 2 +- doc/symbols/jasmine.Reporter.html | 2 +- doc/symbols/jasmine.Runner.html | 2 +- doc/symbols/jasmine.Spec.html | 2 +- doc/symbols/jasmine.Spy.html | 2 +- doc/symbols/jasmine.Suite.html | 2 +- doc/symbols/jasmine.html | 2 +- doc/symbols/jasmine.util.html | 2 +- doc/symbols/src/lib_jasmine-0.10.0.js.html | 2 +- lib/jasmine-0.10.0.js | 46 +++++++++++----------- src/Matchers.js | 44 +++++++++++---------- 19 files changed, 64 insertions(+), 60 deletions(-) diff --git a/doc/files.html b/doc/files.html index d734790..f07ddf5 100644 --- a/doc/files.html +++ b/doc/files.html @@ -272,7 +272,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
\ No newline at end of file diff --git a/doc/index.html b/doc/index.html index 1ac07c8..1271346 100644 --- a/doc/index.html +++ b/doc/index.html @@ -308,7 +308,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
\ No newline at end of file diff --git a/doc/symbols/_global_.html b/doc/symbols/_global_.html index b1c926b..5a02661 100644 --- a/doc/symbols/_global_.html +++ b/doc/symbols/_global_.html @@ -910,7 +910,7 @@ A convenience method that allows existing specs to be disabled temporarily durin
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Block.html b/doc/symbols/jasmine.Block.html index 2779adc..0514cdb 100644 --- a/doc/symbols/jasmine.Block.html +++ b/doc/symbols/jasmine.Block.html @@ -341,7 +341,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Env.html b/doc/symbols/jasmine.Env.html index b411173..6ded92d 100644 --- a/doc/symbols/jasmine.Env.html +++ b/doc/symbols/jasmine.Env.html @@ -509,7 +509,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.JsApiReporter.html b/doc/symbols/jasmine.JsApiReporter.html index 2266619..0f8ba08 100644 --- a/doc/symbols/jasmine.JsApiReporter.html +++ b/doc/symbols/jasmine.JsApiReporter.html @@ -318,7 +318,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Matchers.html b/doc/symbols/jasmine.Matchers.html index f2a3ed5..eb0dabb 100644 --- a/doc/symbols/jasmine.Matchers.html +++ b/doc/symbols/jasmine.Matchers.html @@ -341,7 +341,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.MultiReporter.html b/doc/symbols/jasmine.MultiReporter.html index 25f6ea3..90286ce 100644 --- a/doc/symbols/jasmine.MultiReporter.html +++ b/doc/symbols/jasmine.MultiReporter.html @@ -318,7 +318,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.NestedResults.html b/doc/symbols/jasmine.NestedResults.html index 0d3b246..514167c 100644 --- a/doc/symbols/jasmine.NestedResults.html +++ b/doc/symbols/jasmine.NestedResults.html @@ -702,7 +702,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Reporter.html b/doc/symbols/jasmine.Reporter.html index 14d0cea..7cabaf3 100644 --- a/doc/symbols/jasmine.Reporter.html +++ b/doc/symbols/jasmine.Reporter.html @@ -318,7 +318,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Runner.html b/doc/symbols/jasmine.Runner.html index e032ec0..bff7fc0 100644 --- a/doc/symbols/jasmine.Runner.html +++ b/doc/symbols/jasmine.Runner.html @@ -329,7 +329,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Spec.html b/doc/symbols/jasmine.Spec.html index 4d545e1..053e5a1 100644 --- a/doc/symbols/jasmine.Spec.html +++ b/doc/symbols/jasmine.Spec.html @@ -341,7 +341,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Spy.html b/doc/symbols/jasmine.Spy.html index 082bc07..7b8d6c4 100644 --- a/doc/symbols/jasmine.Spy.html +++ b/doc/symbols/jasmine.Spy.html @@ -847,7 +847,7 @@ expect(foo.bar.callCount).toEqual(0);
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Suite.html b/doc/symbols/jasmine.Suite.html index 8d0ad07..50482b0 100644 --- a/doc/symbols/jasmine.Suite.html +++ b/doc/symbols/jasmine.Suite.html @@ -347,7 +347,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.html b/doc/symbols/jasmine.html index f778213..df08e80 100644 --- a/doc/symbols/jasmine.html +++ b/doc/symbols/jasmine.html @@ -762,7 +762,7 @@ Jasmine environment.
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.util.html b/doc/symbols/jasmine.util.html index 0045b8b..6036bd3 100644 --- a/doc/symbols/jasmine.util.html +++ b/doc/symbols/jasmine.util.html @@ -318,7 +318,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Thu Oct 29 2009 22:18:21 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT)
diff --git a/doc/symbols/src/lib_jasmine-0.10.0.js.html b/doc/symbols/src/lib_jasmine-0.10.0.js.html index 049190e..b9416a2 100644 --- a/doc/symbols/src/lib_jasmine-0.10.0.js.html +++ b/doc/symbols/src/lib_jasmine-0.10.0.js.html @@ -543,7 +543,7 @@ 536 "major": 0, 537 "minor": 10, 538 "build": 0, -539 "revision": 1256874141 +539 "revision": 1256879901 540 }; 541 /** 542 * @namespace diff --git a/lib/jasmine-0.10.0.js b/lib/jasmine-0.10.0.js index a694663..8eb28ad 100644 --- a/lib/jasmine-0.10.0.js +++ b/lib/jasmine-0.10.0.js @@ -536,7 +536,7 @@ jasmine.version_= { "major": 0, "minor": 10, "build": 0, - "revision": 1256879901 + "revision": 1256956024 }; /** * @namespace @@ -1003,8 +1003,8 @@ jasmine.Matchers.prototype.report = function(result, failing_message, details) { return result; }; -jasmine.Matchers.addMatcher = function(matcherName, options) { - jasmine.Matchers.prototype[matcherName] = function () { +jasmine.Matchers.matcherFn_ = function(matcherName, options) { + return function () { jasmine.util.extend(this, options); var matcherArgs = jasmine.util.argsToArray(arguments); var args = [this.actual].concat(matcherArgs); @@ -1026,12 +1026,14 @@ jasmine.Matchers.addMatcher = function(matcherName, options) { }; + + /** * toBe: compares the actual to the expected using === * @param expected */ -jasmine.Matchers.addMatcher('toBe', { +jasmine.Matchers.prototype.toBe = jasmine.Matchers.matcherFn_('toBe', { test: function (actual, expected) { return actual === expected; }, @@ -1044,7 +1046,7 @@ jasmine.Matchers.addMatcher('toBe', { * toNotBe: compares the actual to the expected using !== * @param expected */ -jasmine.Matchers.addMatcher('toNotBe', { +jasmine.Matchers.prototype.toNotBe = jasmine.Matchers.matcherFn_('toNotBe', { test: function (actual, expected) { return actual !== expected; }, @@ -1059,7 +1061,7 @@ jasmine.Matchers.addMatcher('toNotBe', { * @param expected */ -jasmine.Matchers.addMatcher('toEqual', { +jasmine.Matchers.prototype.toEqual = jasmine.Matchers.matcherFn_('toEqual', { test: function (actual, expected) { return this.env.equals_(actual, expected); }, @@ -1072,7 +1074,7 @@ jasmine.Matchers.addMatcher('toEqual', { * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual * @param expected */ -jasmine.Matchers.addMatcher('toNotEqual', { +jasmine.Matchers.prototype.toNotEqual = jasmine.Matchers.matcherFn_('toNotEqual', { test: function (actual, expected) { return !this.env.equals_(actual, expected); }, @@ -1087,7 +1089,7 @@ jasmine.Matchers.addMatcher('toNotEqual', { * * @param reg_exp */ -jasmine.Matchers.addMatcher('toMatch', { +jasmine.Matchers.prototype.toMatch = jasmine.Matchers.matcherFn_('toMatch', { test: function(actual, expected) { return new RegExp(expected).test(actual); }, @@ -1101,7 +1103,7 @@ jasmine.Matchers.addMatcher('toMatch', { * @param reg_exp */ -jasmine.Matchers.addMatcher('toNotMatch', { +jasmine.Matchers.prototype.toNotMatch = jasmine.Matchers.matcherFn_('toNotMatch', { test: function(actual, expected) { return !(new RegExp(expected).test(actual)); }, @@ -1114,7 +1116,7 @@ jasmine.Matchers.addMatcher('toNotMatch', { * Matcher that compares the acutal to undefined. */ -jasmine.Matchers.addMatcher('toBeDefined', { +jasmine.Matchers.prototype.toBeDefined = jasmine.Matchers.matcherFn_('toBeDefined', { test: function(actual) { return (actual !== undefined); }, @@ -1127,7 +1129,7 @@ jasmine.Matchers.addMatcher('toBeDefined', { * Matcher that compares the acutal to undefined. */ -jasmine.Matchers.addMatcher('toBeUndefined', { +jasmine.Matchers.prototype.toBeUndefined = jasmine.Matchers.matcherFn_('toBeUndefined', { test: function(actual) { return (actual === undefined); }, @@ -1140,7 +1142,7 @@ jasmine.Matchers.addMatcher('toBeUndefined', { * Matcher that compares the actual to null. * */ -jasmine.Matchers.addMatcher('toBeNull', { +jasmine.Matchers.prototype.toBeNull = jasmine.Matchers.matcherFn_('toBeNull', { test: function(actual) { return (actual === null); }, @@ -1152,7 +1154,7 @@ jasmine.Matchers.addMatcher('toBeNull', { /** * Matcher that boolean not-nots the actual. */ -jasmine.Matchers.addMatcher('toBeTruthy', { +jasmine.Matchers.prototype.toBeTruthy = jasmine.Matchers.matcherFn_('toBeTruthy', { test: function(actual) { return !!actual; }, @@ -1165,7 +1167,7 @@ jasmine.Matchers.addMatcher('toBeTruthy', { /** * Matcher that boolean nots the actual. */ -jasmine.Matchers.addMatcher('toBeFalsy', { +jasmine.Matchers.prototype.toBeFalsy = jasmine.Matchers.matcherFn_('toBeFalsy', { test: function(actual) { return !actual; }, @@ -1178,7 +1180,7 @@ jasmine.Matchers.addMatcher('toBeFalsy', { * Matcher that checks to see if the acutal, a Jasmine spy, was called. */ -jasmine.Matchers.addMatcher('wasCalled', { +jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.matcherFn_('wasCalled', { getActual_: function() { var args = jasmine.util.argsToArray(arguments); if (args.length > 1) { @@ -1205,7 +1207,7 @@ jasmine.Matchers.addMatcher('wasCalled', { /** * Matcher that checks to see if the acutal, a Jasmine spy, was not called. */ -jasmine.Matchers.addMatcher('wasNotCalled', { +jasmine.Matchers.prototype.wasNotCalled = jasmine.Matchers.matcherFn_('wasNotCalled', { getActual_: function() { var args = jasmine.util.argsToArray(arguments); return args.splice(0, 1)[0]; @@ -1226,7 +1228,7 @@ jasmine.Matchers.addMatcher('wasNotCalled', { } }); -jasmine.Matchers.addMatcher('wasCalledWith', { +jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.matcherFn_('wasCalledWith', { test: function() { var args = jasmine.util.argsToArray(arguments); var actual = args.splice(0, 1)[0]; @@ -1261,7 +1263,7 @@ jasmine.Matchers.addMatcher('wasCalledWith', { * @param {Object} item */ -jasmine.Matchers.addMatcher('toContain', { +jasmine.Matchers.prototype.toContain = jasmine.Matchers.matcherFn_('toContain', { test: function(actual, expected) { return this.env.contains_(actual, expected); }, @@ -1275,7 +1277,7 @@ jasmine.Matchers.addMatcher('toContain', { * * @param {Object} item */ -jasmine.Matchers.addMatcher('toNotContain', { +jasmine.Matchers.prototype.toNotContain = jasmine.Matchers.matcherFn_('toNotContain', { test: function(actual, expected) { return !this.env.contains_(actual, expected); }, @@ -1284,7 +1286,7 @@ jasmine.Matchers.addMatcher('toNotContain', { } }); -jasmine.Matchers.addMatcher('toBeLessThan', { +jasmine.Matchers.prototype.toBeLessThan = jasmine.Matchers.matcherFn_('toBeLessThan', { test: function(actual, expected) { return actual < expected; }, @@ -1293,7 +1295,7 @@ jasmine.Matchers.addMatcher('toBeLessThan', { } }); -jasmine.Matchers.addMatcher('toBeGreaterThan', { +jasmine.Matchers.prototype.toBeGreaterThan = jasmine.Matchers.matcherFn_('toBeGreaterThan', { test: function(actual, expected) { return actual > expected; }, @@ -1307,7 +1309,7 @@ jasmine.Matchers.addMatcher('toBeGreaterThan', { * * @param {String} expectedException */ -jasmine.Matchers.addMatcher('toThrow', { +jasmine.Matchers.prototype.toThrow = jasmine.Matchers.matcherFn_('toThrow', { getException_: function(actual, expected) { var exception; if (typeof actual != 'function') { diff --git a/src/Matchers.js b/src/Matchers.js index 336bab5..cc829e8 100644 --- a/src/Matchers.js +++ b/src/Matchers.js @@ -24,8 +24,8 @@ jasmine.Matchers.prototype.report = function(result, failing_message, details) { return result; }; -jasmine.Matchers.addMatcher = function(matcherName, options) { - jasmine.Matchers.prototype[matcherName] = function () { +jasmine.Matchers.matcherFn_ = function(matcherName, options) { + return function () { jasmine.util.extend(this, options); var matcherArgs = jasmine.util.argsToArray(arguments); var args = [this.actual].concat(matcherArgs); @@ -47,12 +47,14 @@ jasmine.Matchers.addMatcher = function(matcherName, options) { }; + + /** * toBe: compares the actual to the expected using === * @param expected */ -jasmine.Matchers.addMatcher('toBe', { +jasmine.Matchers.prototype.toBe = jasmine.Matchers.matcherFn_('toBe', { test: function (actual, expected) { return actual === expected; }, @@ -65,7 +67,7 @@ jasmine.Matchers.addMatcher('toBe', { * toNotBe: compares the actual to the expected using !== * @param expected */ -jasmine.Matchers.addMatcher('toNotBe', { +jasmine.Matchers.prototype.toNotBe = jasmine.Matchers.matcherFn_('toNotBe', { test: function (actual, expected) { return actual !== expected; }, @@ -80,7 +82,7 @@ jasmine.Matchers.addMatcher('toNotBe', { * @param expected */ -jasmine.Matchers.addMatcher('toEqual', { +jasmine.Matchers.prototype.toEqual = jasmine.Matchers.matcherFn_('toEqual', { test: function (actual, expected) { return this.env.equals_(actual, expected); }, @@ -93,7 +95,7 @@ jasmine.Matchers.addMatcher('toEqual', { * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual * @param expected */ -jasmine.Matchers.addMatcher('toNotEqual', { +jasmine.Matchers.prototype.toNotEqual = jasmine.Matchers.matcherFn_('toNotEqual', { test: function (actual, expected) { return !this.env.equals_(actual, expected); }, @@ -108,7 +110,7 @@ jasmine.Matchers.addMatcher('toNotEqual', { * * @param reg_exp */ -jasmine.Matchers.addMatcher('toMatch', { +jasmine.Matchers.prototype.toMatch = jasmine.Matchers.matcherFn_('toMatch', { test: function(actual, expected) { return new RegExp(expected).test(actual); }, @@ -122,7 +124,7 @@ jasmine.Matchers.addMatcher('toMatch', { * @param reg_exp */ -jasmine.Matchers.addMatcher('toNotMatch', { +jasmine.Matchers.prototype.toNotMatch = jasmine.Matchers.matcherFn_('toNotMatch', { test: function(actual, expected) { return !(new RegExp(expected).test(actual)); }, @@ -135,7 +137,7 @@ jasmine.Matchers.addMatcher('toNotMatch', { * Matcher that compares the acutal to undefined. */ -jasmine.Matchers.addMatcher('toBeDefined', { +jasmine.Matchers.prototype.toBeDefined = jasmine.Matchers.matcherFn_('toBeDefined', { test: function(actual) { return (actual !== undefined); }, @@ -148,7 +150,7 @@ jasmine.Matchers.addMatcher('toBeDefined', { * Matcher that compares the acutal to undefined. */ -jasmine.Matchers.addMatcher('toBeUndefined', { +jasmine.Matchers.prototype.toBeUndefined = jasmine.Matchers.matcherFn_('toBeUndefined', { test: function(actual) { return (actual === undefined); }, @@ -161,7 +163,7 @@ jasmine.Matchers.addMatcher('toBeUndefined', { * Matcher that compares the actual to null. * */ -jasmine.Matchers.addMatcher('toBeNull', { +jasmine.Matchers.prototype.toBeNull = jasmine.Matchers.matcherFn_('toBeNull', { test: function(actual) { return (actual === null); }, @@ -173,7 +175,7 @@ jasmine.Matchers.addMatcher('toBeNull', { /** * Matcher that boolean not-nots the actual. */ -jasmine.Matchers.addMatcher('toBeTruthy', { +jasmine.Matchers.prototype.toBeTruthy = jasmine.Matchers.matcherFn_('toBeTruthy', { test: function(actual) { return !!actual; }, @@ -186,7 +188,7 @@ jasmine.Matchers.addMatcher('toBeTruthy', { /** * Matcher that boolean nots the actual. */ -jasmine.Matchers.addMatcher('toBeFalsy', { +jasmine.Matchers.prototype.toBeFalsy = jasmine.Matchers.matcherFn_('toBeFalsy', { test: function(actual) { return !actual; }, @@ -199,7 +201,7 @@ jasmine.Matchers.addMatcher('toBeFalsy', { * Matcher that checks to see if the acutal, a Jasmine spy, was called. */ -jasmine.Matchers.addMatcher('wasCalled', { +jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.matcherFn_('wasCalled', { getActual_: function() { var args = jasmine.util.argsToArray(arguments); if (args.length > 1) { @@ -226,7 +228,7 @@ jasmine.Matchers.addMatcher('wasCalled', { /** * Matcher that checks to see if the acutal, a Jasmine spy, was not called. */ -jasmine.Matchers.addMatcher('wasNotCalled', { +jasmine.Matchers.prototype.wasNotCalled = jasmine.Matchers.matcherFn_('wasNotCalled', { getActual_: function() { var args = jasmine.util.argsToArray(arguments); return args.splice(0, 1)[0]; @@ -247,7 +249,7 @@ jasmine.Matchers.addMatcher('wasNotCalled', { } }); -jasmine.Matchers.addMatcher('wasCalledWith', { +jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.matcherFn_('wasCalledWith', { test: function() { var args = jasmine.util.argsToArray(arguments); var actual = args.splice(0, 1)[0]; @@ -282,7 +284,7 @@ jasmine.Matchers.addMatcher('wasCalledWith', { * @param {Object} item */ -jasmine.Matchers.addMatcher('toContain', { +jasmine.Matchers.prototype.toContain = jasmine.Matchers.matcherFn_('toContain', { test: function(actual, expected) { return this.env.contains_(actual, expected); }, @@ -296,7 +298,7 @@ jasmine.Matchers.addMatcher('toContain', { * * @param {Object} item */ -jasmine.Matchers.addMatcher('toNotContain', { +jasmine.Matchers.prototype.toNotContain = jasmine.Matchers.matcherFn_('toNotContain', { test: function(actual, expected) { return !this.env.contains_(actual, expected); }, @@ -305,7 +307,7 @@ jasmine.Matchers.addMatcher('toNotContain', { } }); -jasmine.Matchers.addMatcher('toBeLessThan', { +jasmine.Matchers.prototype.toBeLessThan = jasmine.Matchers.matcherFn_('toBeLessThan', { test: function(actual, expected) { return actual < expected; }, @@ -314,7 +316,7 @@ jasmine.Matchers.addMatcher('toBeLessThan', { } }); -jasmine.Matchers.addMatcher('toBeGreaterThan', { +jasmine.Matchers.prototype.toBeGreaterThan = jasmine.Matchers.matcherFn_('toBeGreaterThan', { test: function(actual, expected) { return actual > expected; }, @@ -328,7 +330,7 @@ jasmine.Matchers.addMatcher('toBeGreaterThan', { * * @param {String} expectedException */ -jasmine.Matchers.addMatcher('toThrow', { +jasmine.Matchers.prototype.toThrow = jasmine.Matchers.matcherFn_('toThrow', { getException_: function(actual, expected) { var exception; if (typeof actual != 'function') {