1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

adding test coverage for invalid attribute names

Fixes #171 on github

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2012-08-27 17:57:32 +00:00
parent a5849245c6
commit 2caa432c6a

View file

@ -1452,4 +1452,17 @@ class TestModule < Test::Unit::TestCase
assert_nothing_raised(NoMethodError, Bug6891) {Class.new(x)}
assert_equal(['public', 'protected'], list)
end
def test_invalid_attr
%w[
foo?
@foo
@@foo
$foo
].each do |name|
assert_raises(NameError) do
Module.new { attr_accessor name.to_sym }
end
end
end
end