In
activerecord/test/cases/associations/has_one_associations_test.rb:331
there is a test method with an exclamation point in the middle of
the method name:
def test_create!_respects_hash_condition
account = companies(:first_firm).create_account_limit_500_with_hash_conditions!
assert !account.new_record?
assert_equal 500, account.credit_limit
end
This won't be catched if run with classic TestUnit (*).
Changing the test name to test_create_bang_respects_hash_condition
shows that the test is actually failing:
1) Error:
test_create_bang_respects_hash_condition(HasOneAssociationsTest):
NoMethodError: undefined method
create_account_limit_500_with_hash_conditions!' for
#<Firm:0x000001024ab948>
I think that there are no create_something! bang methods
supposed to be generated. (?!?)
(-> ActiveRecord::Associations Rdoc :
activerecord/lib/active_record/associations.rb:154 ff)
The patch removes the test.
(*) Following test suite will pass (with Ruby 1.9.1p243):
require "test/unit"
class MyTest < Test::Unit::TestCase
def test!_me
raise
has no effect because this will never be evaluated!
end
def test_something
end
end