mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Fixed failing matcher tests
This commit is contained in:
parent
ef6ffc98de
commit
3c6fb6e0b3
2 changed files with 10 additions and 3 deletions
2
Rakefile
2
Rakefile
|
@ -8,7 +8,7 @@ require 'shoulda'
|
|||
load 'tasks/shoulda.rake'
|
||||
|
||||
# Test::Unit::UI::VERBOSE
|
||||
test_files_pattern = 'test/{unit,functional,other}/**/*_test.rb'
|
||||
test_files_pattern = 'test/{unit,functional,other,matchers}/**/*_test.rb'
|
||||
Rake::TestTask.new do |t|
|
||||
t.libs << 'lib'
|
||||
t.pattern = test_files_pattern
|
||||
|
|
|
@ -78,7 +78,7 @@ module Shoulda # :nodoc:
|
|||
if @scopes.blank?
|
||||
true
|
||||
else
|
||||
@scopes.each do |scope|
|
||||
@scopes.all? do |scope|
|
||||
previous_value = @existing.send(scope)
|
||||
|
||||
# Assume the scope is a foreign key if the field is nil
|
||||
|
@ -88,7 +88,14 @@ module Shoulda # :nodoc:
|
|||
|
||||
@subject.send("#{scope}=", next_value)
|
||||
|
||||
allows_value_of(existing_value, @expected_message)
|
||||
if allows_value_of(existing_value, @expected_message)
|
||||
@negative_failure_message <<
|
||||
" (with different value of #{scope})"
|
||||
true
|
||||
else
|
||||
@failure_message << " (with different value of #{scope})"
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue