| 1 |
(function($) { |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
module('jQuery#awesome', { |
| 24 |
|
| 25 |
setup: function() { |
| 26 |
this.elems = $('#qunit-fixture').children(); |
| 27 |
} |
| 28 |
}); |
| 29 |
|
| 30 |
test('is chainable', function() { |
| 31 |
expect(1); |
| 32 |
|
| 33 |
strictEqual(this.elems.awesome(), this.elems, 'should be chainable'); |
| 34 |
}); |
| 35 |
|
| 36 |
test('is awesome', function() { |
| 37 |
expect(1); |
| 38 |
strictEqual(this.elems.awesome().text(), 'awesome0awesome1awesome2', 'should be awesome'); |
| 39 |
}); |
| 40 |
|
| 41 |
module('jQuery.awesome'); |
| 42 |
|
| 43 |
test('is awesome', function() { |
| 44 |
expect(2); |
| 45 |
strictEqual($.awesome(), 'awesome.', 'should be awesome'); |
| 46 |
strictEqual($.awesome({punctuation: '!'}), 'awesome!', 'should be thoroughly awesome'); |
| 47 |
}); |
| 48 |
|
| 49 |
module(':awesome selector', { |
| 50 |
|
| 51 |
setup: function() { |
| 52 |
this.elems = $('#qunit-fixture').children(); |
| 53 |
} |
| 54 |
}); |
| 55 |
|
| 56 |
test('is awesome', function() { |
| 57 |
expect(1); |
| 58 |
|
| 59 |
deepEqual(this.elems.filter(':awesome').get(), this.elems.last().get(), 'knows awesome when it sees it'); |
| 60 |
}); |
| 61 |
|
| 62 |
}(jQuery)); |