summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 19:40:13 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 19:40:13 +0000
commitf56c0c063174caa417ca1e54d59d76c266026bbf (patch)
tree6016d17aec0830656f1fd1259e0d97037abce714 /test
parent12f4488c582a4f80bfe971754dbf7da7df2cea95 (diff)
merge revision(s) 41389: [Backport #8540]
* 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 [ruby-core:55543] [Bug #8540] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 9db30ee39c..1239711756 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1165,6 +1165,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")