diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-18 14:01:32 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-18 14:01:32 +0000 |
commit | 65dc35a58245f9afa529803450318c8067bca786 (patch) | |
tree | 7713c00eb8a3438e31485cd58886b6c6a8cadf95 /test/ruby/test_module.rb | |
parent | 0a3f79310f0135c1f48af0b5147e9bd0b830bd16 (diff) |
* vm_insnhelper.c (vm_call_method): ensure methods of type
VM_METHOD_TYPE_ATTR_SET are called with 1 argument
* test/ruby/test_module.rb (class TestModule): add test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 5574bf0567..361a6fe993 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1167,6 +1167,14 @@ class TestModule < Test::Unit::TestCase assert_equal(1, c.x, bug3406) end + def test_attr_writer_with_no_arguments + bug8540 = "[ruby-core:55543]" + c = Class.new do + attr_writer :foo + end + assert_raise(ArgumentError) { c.new.send :foo= } + end + def test_private_constant c = Class.new c.const_set(:FOO, "foo") |