aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorOriol Gual and Josep M. Bach <dev+oriol+txus@codegram.com>2011-02-28 14:31:29 +0100
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-28 13:30:32 -0200
commitf42562f97bb791a7662fce0106a93eec211b2803 (patch)
tree99779ed409b770f3506f252fe03fd6a74ba705f5 /activesupport/test
parenta0629927b2b615a747eb223eb82e84b208d49188 (diff)
downloadrails-f42562f97bb791a7662fce0106a93eec211b2803.tar.gz
rails-f42562f97bb791a7662fce0106a93eec211b2803.tar.bz2
rails-f42562f97bb791a7662fce0106a93eec211b2803.zip
Make ActiveSupport::Configurable work with modules
[#6486 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/configurable_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/test/configurable_test.rb b/activesupport/test/configurable_test.rb
index 9c773c1944..2b28e61815 100644
--- a/activesupport/test/configurable_test.rb
+++ b/activesupport/test/configurable_test.rb
@@ -21,6 +21,12 @@ class ConfigurableActiveSupport < ActiveSupport::TestCase
assert_equal({ :foo => :bar }, Parent.config)
end
+ test "adds a configuration hash to a module as well" do
+ mixin = Module.new { include ActiveSupport::Configurable }
+ mixin.config.foo = :bar
+ assert_equal({ :foo => :bar }, mixin.config)
+ end
+
test "configuration hash is inheritable" do
assert_equal :bar, Child.config.foo
assert_equal :bar, Parent.config.foo
@@ -57,4 +63,4 @@ class ConfigurableActiveSupport < ActiveSupport::TestCase
assert_respond_to child.config, :bar
assert_respond_to child.new.config, :bar
end
-end \ No newline at end of file
+end