From 0f0b60ea86af7fd9db03639a8a92d63a49e94f24 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 2 Aug 2013 14:58:11 +0000 Subject: * vm.c (m_core_define_method, m_core_define_singleton_method): now the value of def-expr is the Symbol of the name of the method, not nil. ref. [ruby-dev:42151] [Feature #3753] * test/ruby/test_syntax.rb (TestSyntax#test_value_of_def): test for above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 9daa0e4d49..99470691ef 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -370,6 +370,13 @@ eom end end + def test_value_of_def + assert_separately [], <<-EOS + assert_equal(:foo, (def foo; end)) + assert_equal(:foo, (def (Object.new).foo; end)) + EOS + end + private def not_label(x) @result = x; @not_label ||= nil end -- cgit v1.2.3