aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-25 05:58:38 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-25 05:58:38 +0000
commit9898a62bf79f5a4f6250b2ee17583d0f44ee1bc5 (patch)
treeb91239e31fbc5e5f0a725c55bb09df35aca7739f
parent133fe85f2baa54a676157c0598d6c7c5f8d78a96 (diff)
downloadrails-9898a62bf79f5a4f6250b2ee17583d0f44ee1bc5.tar.gz
rails-9898a62bf79f5a4f6250b2ee17583d0f44ee1bc5.tar.bz2
rails-9898a62bf79f5a4f6250b2ee17583d0f44ee1bc5.zip
use a real test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-xactiverecord/test/associations_test.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb
index e516125e80..aaafb0e396 100755
--- a/activerecord/test/associations_test.rb
+++ b/activerecord/test/associations_test.rb
@@ -11,20 +11,17 @@ require 'fixtures/category'
require 'fixtures/post'
require 'fixtures/author'
-# Can't declare new classes in test case methods, so tests before that
-bad_collection_keys = false
-begin
- class Car < ActiveRecord::Base; has_many :wheels, :name => "wheels"; end
-rescue ArgumentError
- bad_collection_keys = true
-end
-raise "ActiveRecord should have barked on bad collection keys" unless bad_collection_keys
-
class AssociationsTest < Test::Unit::TestCase
fixtures :accounts, :companies, :developers, :projects, :developers_projects,
:computers
+ def test_bad_collection_keys
+ assert_raise(ArgumentError, 'ActiveRecord should have barked on bad collection keys') do
+ Class.new(ActiveRecord::Base).has_many(:wheels, :name => 'wheels')
+ end
+ end
+
def test_force_reload
firm = Firm.new("name" => "A New Firm, Inc")
firm.save