| 245 | }; |
| 246 | |
| 247 | var bindMatcher = function(methodName) { |
| 248 | var builtInMatcher = jasmine.Matchers.prototype[methodName]; |
| 249 | |
| 250 | jasmine.JQuery.matchersClass[methodName] = function() { |
| 251 | if (this.actual instanceof jQuery) { |
| 252 | var result = jQueryMatchers[methodName].apply(this, arguments); |
| 253 | this.actual = jasmine.JQuery.elementToString(this.actual); |
| 254 | return result; |
| 255 | } |
| 256 | |
| 257 | if (builtInMatcher) { |
| 258 | return builtInMatcher.apply(this, arguments); |
| 259 | } |
| 260 | |
| 261 | return false; |
| 262 | }; |
| 263 | }; |
| 264 | |
| 265 | for(var methodName in jQueryMatchers) { |
| 266 | bindMatcher(methodName); |