lib/dm/matchers/validate_presence_of.rb in dm-rspec-0.2.4 vs lib/dm/matchers/validate_presence_of.rb in dm-rspec-0.3.0
- old
+ new
@@ -17,9 +17,19 @@
return false unless presence_of
return false if @msg and @msg != presence_of.options[:message]
true
end
- end
+ def failure_message_for_presence
+ "expected to validate presence of #{@property}#{with_msg}"
+ end
+ def negative_failure_message
+ "expected to not validate presence of #{@property}#{with_msg}"
+ end
+
+ def with_msg
+ " with message \"#{@msg}\"" if @msg
+ end
+ end
end
end