rva - Added a 'should_match' regex matcher

This commit is contained in:
pivotal
2008-12-19 18:13:48 -08:00
parent 5057329af7
commit d9345b3874
3 changed files with 78 additions and 74 deletions

View File

@@ -200,6 +200,11 @@ Jasmine.Matchers.method('should_not_equal', function (expected) {
'Expected ' + expected + ' to not equal ' + this.actual + ', but it does.');
});
Jasmine.Matchers.method('should_match', function (reg_exp) {
return this.report((reg_exp.match(this.actual)),
'Expected ' + this.actual + ' to match ' + reg_exp + '.');
});
/*
* Jasmine spec constructor
*/