diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-28 10:32:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-28 10:32:16 +0000 |
commit | afb4bcbfd6a4d315093285679d9aa9270ad7d1ab (patch) | |
tree | 7d2ba023b91ba21dac9099625e5759d49bf2042c /test/-ext-/struct/test_member.rb | |
parent | 4a3f08d397889f24504c74ee5c7165dcc8a26c36 (diff) | |
download | ruby-afb4bcbfd6a4d315093285679d9aa9270ad7d1ab.tar.gz |
struct.c: not_a_member message
* struct.c (not_a_member): extract name error and use same error
messages. based on the patch by Marcus Stollsteimer <sto.mar AT
web.de> at [ruby-core:61721]. [Bug #9684]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/struct/test_member.rb')
-rw-r--r-- | test/-ext-/struct/test_member.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/-ext-/struct/test_member.rb b/test/-ext-/struct/test_member.rb new file mode 100644 index 0000000000..002941c95d --- /dev/null +++ b/test/-ext-/struct/test_member.rb @@ -0,0 +1,12 @@ +require 'test/unit' +require "-test-/struct" + +class Bug::Struct::Test_Member < Test::Unit::TestCase + S = Bug::Struct.new(:a) + + def test_member_get + s = S.new(1) + assert_equal(1, s.get(:a)) + assert_raise_with_message(NameError, /is not a struct member/) {s.get(:b)} + end +end |