aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-03-28 18:25:06 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-03-28 18:25:06 +0200
commitc82fd8fc2ac9f8273825fc272a0bf17e5c583d71 (patch)
tree75c530d044fb4e17b5c48ffc7d91a2d435a4e497 /activemodel
parent5a5ca14cb2f636b9edf03b56bd9aae4cef5c7200 (diff)
downloadrails-c82fd8fc2ac9f8273825fc272a0bf17e5c583d71.tar.gz
rails-c82fd8fc2ac9f8273825fc272a0bf17e5c583d71.tar.bz2
rails-c82fd8fc2ac9f8273825fc272a0bf17e5c583d71.zip
Allow ActiveModel::Name to duck type
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/lint.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/lib/active_model/lint.rb b/activemodel/lib/active_model/lint.rb
index 210f9a9468..88b730626c 100644
--- a/activemodel/lib/active_model/lint.rb
+++ b/activemodel/lib/active_model/lint.rb
@@ -78,10 +78,10 @@ module ActiveModel
def test_model_naming
assert model.class.respond_to?(:model_name), "The model should respond to model_name"
model_name = model.class.model_name
- assert_kind_of ActiveModel::Name, model_name
- assert_kind_of String, model_name.human
- assert_kind_of String, model_name.singular
- assert_kind_of String, model_name.plural
+ assert model_name.respond_to?(:to_str)
+ assert model_name.human.respond_to?(:to_str)
+ assert model_name.singular.respond_to?(:to_str)
+ assert model_name.plural.respond_to?(:to_str)
end
# == Errors Testing