summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_module.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index d3012e59ae..d2da384cbd 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -587,6 +587,28 @@ class TestModule < Test::Unit::TestCase
m1.include m2
m1.include m3
assert_equal([:m1, :sc, :m2, :m3, :c], o.foo)
+
+ m1, m2, m3, sc, o = modules.call
+ assert_equal([:sc, :c], o.foo)
+ sc.prepend m1
+ assert_equal([:m1, :sc, :c], o.foo)
+ m1.prepend m2
+ assert_equal([:m2, :m1, :sc, :c], o.foo)
+ m2.prepend m3
+ assert_equal([:m3, :m2, :m1, :sc, :c], o.foo)
+ m1, m2, m3, sc, o = modules.call
+ sc.include m1
+ assert_equal([:sc, :m1, :c], o.foo)
+ sc.prepend m2
+ assert_equal([:m2, :sc, :m1, :c], o.foo)
+ sc.prepend m3
+ assert_equal([:m3, :m2, :sc, :m1, :c], o.foo)
+ m1, m2, m3, sc, o = modules.call
+ sc.include m1
+ assert_equal([:sc, :m1, :c], o.foo)
+ m2.prepend m3
+ m1.include m2
+ assert_equal([:sc, :m1, :m3, :m2, :c], o.foo)
end
def test_included_modules