Commit Graph

5 Commits

Author SHA1 Message Date
Frank Luithle cab62a1697 allow multiple values for AllowValueMatcher
With the deprecation of "should_allow_values_for" there is currently no clean
way to specify multiple allowed (or forbidden) values for an attribute in a
single assertion. This can make test cases unnecessarily verbose.

This patch gives AllowValueMatcher the ability to take multiple values. The new
matcher is fully downward compatible (i.e. given a single argument it behaves
identically to the old matcher).

This matcher will stop checking for bad values when the first bad value is
encountered.
2012-03-23 09:53:08 -04:00
Frank Luithle c86d8e2e0c remove a redundancy inside AllowValueMatcher 2012-03-23 09:49:50 -04:00
Frank Luithle 026927b324 optimize AllowValueMatcher slightly 2012-03-23 09:49:50 -04:00
Clemens Helm 662b674cf4 Implemented all possible i18n error messages for validations. 2011-11-17 11:57:57 +01:00
Markus Schwed 2a54fdb28d Seperate ActiveRecord and ActiveModel related matchers 2011-05-06 15:56:36 +02:00
Renamed from lib/shoulda/matchers/active_record/allow_value_matcher.rb (Browse further)