lib/matchers/validations.rb in glebtv-mongoid-rspec-1.12.0 vs lib/matchers/validations.rb in glebtv-mongoid-rspec-3.0.0
- old
+ new
@@ -35,9 +35,12 @@
def failure_message_for_should_not
"Expected #{@klass.inspect} to not #{description}; instead got #{@positive_result_message}"
end
+ alias :failure_message :failure_message_for_should
+ alias :failure_message_when_negated :failure_message_for_should_not
+
def description
desc = "have #{@type.inspect} validator on #{@field.inspect}"
desc << " on #{@options[:on]}" if @options[:on]
desc
end