From 9063f3729b42105d1fdcede21c43e6e4ce1dcabb Mon Sep 17 00:00:00 2001 From: kennyj Date: Wed, 29 Aug 2012 02:21:39 +0900 Subject: [PATCH] Fix method redefined warnings. --- .../test/cases/validations/exclusion_validation_test.rb | 3 +++ .../test/cases/validations/inclusion_validation_test.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/activemodel/test/cases/validations/exclusion_validation_test.rb b/activemodel/test/cases/validations/exclusion_validation_test.rb index 9f916dbfdd..7d5af27f3d 100644 --- a/activemodel/test/cases/validations/exclusion_validation_test.rb +++ b/activemodel/test/cases/validations/exclusion_validation_test.rb @@ -78,6 +78,9 @@ class ExclusionValidationTest < ActiveModel::TestCase assert p.invalid? assert_equal ["is reserved"], p.errors[:karma] + p = Person.new + p.karma = "abe" + def p.reserved_karmas %w() end diff --git a/activemodel/test/cases/validations/inclusion_validation_test.rb b/activemodel/test/cases/validations/inclusion_validation_test.rb index 92638f8e70..117e9109fc 100644 --- a/activemodel/test/cases/validations/inclusion_validation_test.rb +++ b/activemodel/test/cases/validations/inclusion_validation_test.rb @@ -110,6 +110,9 @@ class InclusionValidationTest < ActiveModel::TestCase assert p.invalid? assert_equal ["is not included in the list"], p.errors[:karma] + p = Person.new + p.karma = "Lifo" + def p.available_karmas %w(Lifo) end