(name, method, message)
| 4099 | } |
| 4100 | |
| 4101 | function mirrorPropAsAssertion(name, method, message) { |
| 4102 | if (arguments.length == 2) { |
| 4103 | message = method; |
| 4104 | method = name; |
| 4105 | } |
| 4106 | |
| 4107 | assert[name] = function (fake) { |
| 4108 | verifyIsStub(fake); |
| 4109 | |
| 4110 | var args = slice.call(arguments, 1); |
| 4111 | var failed = false; |
| 4112 | |
| 4113 | if (typeof method == "function") { |
| 4114 | failed = !method(fake); |
| 4115 | } else { |
| 4116 | failed = typeof fake[method] == "function" ? |
| 4117 | !fake[method].apply(fake, args) : !fake[method]; |
| 4118 | } |
| 4119 | |
| 4120 | if (failed) { |
| 4121 | failAssertion(this, fake.printf.apply(fake, [message].concat(args))); |
| 4122 | } else { |
| 4123 | assert.pass(name); |
| 4124 | } |
| 4125 | }; |
| 4126 | } |
| 4127 | |
| 4128 | function exposedName(prefix, prop) { |
| 4129 | return !prefix || /^fail/.test(prop) ? prop : |
no test coverage detected
searching dependent graphs…