diff --git a/lib/ext/match.js b/lib/ext/match.js index 9baa2fc..eec08c2 100644 --- a/lib/ext/match.js +++ b/lib/ext/match.js @@ -5,7 +5,7 @@ * MIT Licensed */ -import { format, forEach, isIndexable, formatProp, some } from '../util'; +import { format, forEach, formatProp, some } from '../util'; import eql from 'should-equal'; export default function(should, Assertion) { @@ -76,10 +76,6 @@ export default function(should, Assertion) { if (typeof this.obj == 'string') { this.assert(other.exec(this.obj)); - } else if (isIndexable(this.obj)) { - forEach(this.obj, function(item) { - this.assert(other.exec(item));// should we try to convert to String and exec? - }, this); } else if (null != this.obj && typeof this.obj == 'object') { var notMatchedProps = [], matchedProps = []; diff --git a/test/ext/match.test.js b/test/ext/match.test.js index 81417de..9d6904e 100644 --- a/test/ext/match.test.js +++ b/test/ext/match.test.js @@ -46,11 +46,11 @@ describe('match', function() { err(function() { ['a', 'b', 'c'].should.not.match(/[a-z]/); - }, "expected Array [ 'a', 'b', 'c' ] not to match /[a-z]/ (false negative fail)"); + }, "expected Array [ 'a', 'b', 'c' ] not to match /[a-z]/\n matched properties: '0', '1', '2' (false negative fail)"); err(function() { ['a', 'b', 'c'].should.match(/[d-z]/); - }, "expected Array [ 'a', 'b', 'c' ] to match /[d-z]/"); + }, "expected Array [ 'a', 'b', 'c' ] to match /[d-z]/\n not matched properties: \'0\' (\'a\'), \'1\' (\'b\'), \'2\' (\'c\')"); }); it('test match(function)', function() {