Permalink
Browse files

Set the value for the failing attribute

  • Loading branch information...
1 parent 94a0cbd commit 06e4192e856d185b31b808a37cdb224ef4f1a7a2 @drapergeek drapergeek committed with gabebw Aug 7, 2012
@@ -45,6 +45,7 @@ def with_message(message)
def matches?(instance)
@instance = instance
@values_to_match.none? do |value|
+ @value = value
PositiveErrorDescription.new(instance, @attribute, value, @options[:expected_message]).matches?
end
end
@@ -41,7 +41,7 @@
it 'is correct' do
expected_failure_message = 'Expected errors when attr is set to "present", got no errors'
matcher = matcher_class.new('present').for(:attr)
- matcher.matches?(model)
+ matcher.matches?(model).should be_false
matcher.failure_message.should == expected_failure_message
end
end

0 comments on commit 06e4192

Please sign in to comment.