aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/configurable_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-09-27 20:10:04 +0200
committerJosé Valim <jose.valim@gmail.com>2010-09-27 20:10:04 +0200
commit756b32ef3986992d6e49ed0862ed0f2e314aec6f (patch)
treed6ae3e85c63ca7b40f9454c975b9e91373f94c95 /activesupport/test/configurable_test.rb
parentfbd1d306b95cc2efb6422e12d26d5818a3a42343 (diff)
parent9c57bd8578e5ed47f143a2755b03ffd2ef85c65d (diff)
downloadrails-756b32ef3986992d6e49ed0862ed0f2e314aec6f.tar.gz
rails-756b32ef3986992d6e49ed0862ed0f2e314aec6f.tar.bz2
rails-756b32ef3986992d6e49ed0862ed0f2e314aec6f.zip
Merge remote branch 'thedarkone/performance'
Diffstat (limited to 'activesupport/test/configurable_test.rb')
-rw-r--r--activesupport/test/configurable_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/activesupport/test/configurable_test.rb b/activesupport/test/configurable_test.rb
index cef67e3cf9..4f288eb4d5 100644
--- a/activesupport/test/configurable_test.rb
+++ b/activesupport/test/configurable_test.rb
@@ -39,4 +39,22 @@ class ConfigurableActiveSupport < ActiveSupport::TestCase
assert_equal :baz, instance.config.foo
assert_equal :bar, Parent.config.foo
end
+
+ test "configuration is crystalizeable" do
+ parent = Class.new { include ActiveSupport::Configurable }
+ child = Class.new(parent)
+
+ parent.config.bar = :foo
+ assert !parent.config.respond_to?(:bar)
+ assert !child.config.respond_to?(:bar)
+ assert !child.new.config.respond_to?(:bar)
+
+ parent.config.crystalize!
+ assert_equal :foo, parent.config.bar
+ assert_equal :foo, child.new.config.bar
+
+ assert_respond_to parent.config, :bar
+ assert_respond_to child.config, :bar
+ assert_respond_to child.new.config, :bar
+ end
end \ No newline at end of file