diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-05-07 10:29:22 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-05-07 10:29:22 -0500 |
commit | 2854535b02bcee3668bda02c76c3105fc24730d3 (patch) | |
tree | b78660942bdc6f532a1109da57ee40d7d31cf603 /activesupport/test/core_ext | |
parent | 783deae99a4850f597135146b19e7ee4622da94e (diff) | |
download | rails-2854535b02bcee3668bda02c76c3105fc24730d3.tar.gz rails-2854535b02bcee3668bda02c76c3105fc24730d3.tar.bz2 rails-2854535b02bcee3668bda02c76c3105fc24730d3.zip |
Make module dependency DSL opt in
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/module/setup_test.rb | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/activesupport/test/core_ext/module/setup_test.rb b/activesupport/test/core_ext/module/setup_test.rb deleted file mode 100644 index 132790f2ff..0000000000 --- a/activesupport/test/core_ext/module/setup_test.rb +++ /dev/null @@ -1,74 +0,0 @@ -require 'abstract_unit' -require 'active_support/core/time' -require 'active_support/core_ext/module/setup' - -class SetupTest < Test::Unit::TestCase - module Baz - module ClassMethods - def baz - "baz" - end - - def setup=(value) - @@setup = value - end - - def setup - @@setup - end - end - - setup do - self.setup = true - end - - def baz - "baz" - end - end - - module Bar - depends_on Baz - - def bar - "bar" - end - - def baz - "bar+" + super - end - end - - def setup - @klass = Class.new - end - - def test_module_is_included_normally - @klass.use(Baz) - assert_equal "baz", @klass.new.baz - assert_equal SetupTest::Baz, @klass.included_modules[0] - - @klass.use(Baz) - assert_equal "baz", @klass.new.baz - assert_equal SetupTest::Baz, @klass.included_modules[0] - end - - def test_class_methods_are_extended - @klass.use(Baz) - assert_equal "baz", @klass.baz - assert_equal SetupTest::Baz::ClassMethods, (class << @klass; self.included_modules; end)[0] - end - - def test_setup_block_is_ran - @klass.use(Baz) - assert_equal true, @klass.setup - end - - def test_modules_dependencies_are_met - @klass.use(Bar) - assert_equal "bar", @klass.new.bar - assert_equal "bar+baz", @klass.new.baz - assert_equal "baz", @klass.baz - assert_equal [SetupTest::Bar, SetupTest::Baz], @klass.included_modules[0..1] - end -end |