* Generate an attr assertion function for the given attr `name`. * * @param {String} name * @return {Function} * @api private
(name)
| 398 | */ |
| 399 | |
| 400 | function attr(name) { |
| 401 | return function(expected){ |
| 402 | var elem = this.obj |
| 403 | , val = elem.attr(name); |
| 404 | |
| 405 | this.assert( |
| 406 | expected == val |
| 407 | , 'expected ' + j(elem) + ' to have ' + name + ' ' + i(expected) + ', but has ' + i(val) |
| 408 | , 'expected ' + j(elem) + ' to not have ' + name + ' ' + i(expected)); |
| 409 | |
| 410 | return this; |
| 411 | } |
| 412 | } |