We haven’t been taking pull requests on shoulda-matchers as much as we shoulda, but it’s back in the spotlight now. Shoulda’s been gone … but it’s back.
Here are the new features in shoulda-matchers 1.1.0:
- A NEWS fileso you can track new hottness in REAL TIME
- shoulda-matchers’ very first dependency: ActiveSupport >= 3.0.0. This was an implicit dependency for a while, but now it’s official.
- An
only_integeroption forvalidates_numericality_of - A
query_the_databasematcher, so that you can doit { should query_the_database(4.times).or_less } - Database column primality is correctly checked
- The flash matcher can check specific keys using
[], like so:it { should set_the_flash[:alert].to("Bad username") } - A
validates_confirmation_ofmatcher:it { should validate_confirmation_of(:password) } - A
serializematcher:it { should serialize(:details).as(Hash).as_instance_of(Hash) } - A
have_sent_emailmatcher can now checkreply_to: it { should have_sent_email.reply_to([user, other]) } - An
accept_nested_attributesmatcher
If you filed a pull request and we didn’t take a look, please re-submit or ping me on Github. We’d love to hear from you.