Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Failing test hidden by exclamation point in test method name

#3534

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

Reported by Matthias Hennemeyer · December 2nd, 2009 @ 10:59 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Marius Nuennerich
    Marius Nuennerich

    Method was deleted in 3e6e3e90ef432f9fa70ee07e4ac4924e9005dc71.

    May 1st, 2010 @ 01:55 PM

  2. Ryan Bigg
    Ryan Bigg
    • State changed from new to resolved

    May 25th, 2010 @ 09:56 AM