Closed paixaop closed 11 years ago
Use regex.test instead of exec.
As Tj already said, min/max already available but with another names. I do not think specific regexps should be in should.js - at least while it is testing library.
BTD I agree with you, not having specific regexps in a testing library, but some regexps like email validity testing are very common, and are really easy to get wrong. The likely outcome of each user writing their own regexp to test the validity of an email address is a lot of bugs.
You can every time create a plugin for should.js. Just extend Assertion.prototype
and require where you need it.
Hi I added validators for min, max, email and url min (>=) and max (<=) work like above and bellow, but are inclusive of the given number.
email test for RFC822 address url tests for valid URLs
hope you can merge these back in.