summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-15 09:28:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-15 09:28:45 +0000
commit4ea616b387d50e96bac26ea5dd99812bfc717b03 (patch)
tree26aaef512e2e6f18906d627e534b67e1a0938b51 /test
parent9fec02ad20c0c78edde6e5b00c1d3ddabcaea14b (diff)
vm_method.c: check if frozen [Fix GH-1096]
* vm_method.c (set_method_visibility): should fail if the receiver is frozen. [ruby-core:71489] [Bug #11687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 19cf418cf1..dbbeca850d 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -624,13 +624,22 @@ class TestModule < Test::Unit::TestCase
end
def test_freeze
- m = Module.new
+ m = Module.new do
+ def self.baz; end
+ def bar; end
+ end
m.freeze
assert_raise(RuntimeError) do
m.module_eval do
def foo; end
end
end
+ assert_raise(RuntimeError) do
+ m.__send__ :private, :bar
+ end
+ assert_raise(RuntimeError) do
+ m.private_class_method :baz
+ end
end
def test_attr_obsoleted_flag