(name, method, message)
| 4674 | } |
| 4675 | |
| 4676 | function mirrorPropAsAssertion(name, method, message) { |
| 4677 | if (arguments.length == 2) { |
| 4678 | message = method; |
| 4679 | method = name; |
| 4680 | } |
| 4681 | |
| 4682 | assert[name] = function (fake) { |
| 4683 | verifyIsStub(fake); |
| 4684 | |
| 4685 | var args = slice.call(arguments, 1); |
| 4686 | var failed = false; |
| 4687 | |
| 4688 | if (typeof method == "function") { |
| 4689 | failed = !method(fake); |
| 4690 | } else { |
| 4691 | failed = typeof fake[method] == "function" ? |
| 4692 | !fake[method].apply(fake, args) : !fake[method]; |
| 4693 | } |
| 4694 | |
| 4695 | if (failed) { |
| 4696 | failAssertion(this, fake.printf.apply(fake, [message].concat(args))); |
| 4697 | } else { |
| 4698 | assert.pass(name); |
| 4699 | } |
| 4700 | }; |
| 4701 | } |
| 4702 | |
| 4703 | function exposedName(prefix, prop) { |
| 4704 | return !prefix || /^fail/.test(prop) ? prop : |
no test coverage detected
searching dependent graphs…