mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
* eval.c (Init_eval): Make Module#include and Module#prepend public
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1908874bf4
commit
26766ee89c
3 changed files with 21 additions and 2 deletions
|
@ -351,6 +351,12 @@ class TestModule < Test::Unit::TestCase
|
|||
refute_equal original, b.inspect, bug6454
|
||||
end
|
||||
|
||||
def test_public_include
|
||||
assert_nothing_raised('#8846') do
|
||||
Module.new.include(Module.new { def foo; end }).instance_methods == [:foo]
|
||||
end
|
||||
end
|
||||
|
||||
def test_included_modules
|
||||
assert_equal([], Mixin.included_modules)
|
||||
assert_equal([Mixin], User.included_modules)
|
||||
|
@ -1380,6 +1386,12 @@ class TestModule < Test::Unit::TestCase
|
|||
assert_equal(expected, obj.m1)
|
||||
end
|
||||
|
||||
def test_public_prepend
|
||||
assert_nothing_raised('#8846') do
|
||||
Class.new.prepend(Module.new)
|
||||
end
|
||||
end
|
||||
|
||||
def test_prepend_inheritance
|
||||
bug6654 = '[ruby-core:45914]'
|
||||
a = labeled_module("a")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue