diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-09-14 18:26:26 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-09-14 18:26:26 +0200 |
commit | afd5465a6129e96bce62dab26a4ee41e7af7365c (patch) | |
tree | 6e500ed55e65a6f6e5991913f11850d17c8ed721 /test/assertions.js | |
parent | 3bf592f870eb24d1b4753fa538bad2cbfaa98a24 (diff) | |
parent | fe604733debe42a287f3c44705e16d9d0ec85908 (diff) | |
download | gitbook-afd5465a6129e96bce62dab26a4ee41e7af7365c.zip gitbook-afd5465a6129e96bce62dab26a4ee41e7af7365c.tar.gz gitbook-afd5465a6129e96bce62dab26a4ee41e7af7365c.tar.bz2 |
Merge pull request #928 from GitbookIO/feature/highlight_block
Code highlighting extended by plugins
Diffstat (limited to 'test/assertions.js')
-rw-r--r-- | test/assertions.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/assertions.js b/test/assertions.js index 7a34380..f81645b 100644 --- a/test/assertions.js +++ b/test/assertions.js @@ -26,14 +26,27 @@ should.Assertion.add('html', function(rules, description) { _.each(rules, function(validations, query) { validations = _.defaults(validations || {}, { + // Select a specific element in the list of matched elements + index: null, + + // Check that there is the correct count of elements count: 1, + + // Check attribute values attributes: {}, + + // Trim inner text trim: false, + + // Check inner text text: undefined }); var $el = $(query); + // Select correct element + if (_.isNumber(validations.index)) $el = $($el.get(validations.index)); + // Test number of elements $el.length.should.be.equal(validations.count); |