diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-01-29 00:49:53 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-01-29 00:54:05 +0900 |
commit | 7882c43fc306c1100be8e1648f3d1caa48d50a8a (patch) | |
tree | c0e7dd7c77e0a4c8bd190fe54933c1a29fb926b9 /test/ruby/test_method.rb | |
parent | 7342867fc9a7025187ea18ddbf2bc972a120d962 (diff) | |
download | ruby-7882c43fc306c1100be8e1648f3d1caa48d50a8a.tar.gz |
refactoring: use Proc and Constant.
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r-- | test/ruby/test_method.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index dd163e104c..563011a03f 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -1108,7 +1108,7 @@ class TestMethod < Test::Unit::TestCase assert_equal([:bar, :foo], b.local_variables.sort, bug11012) end - setup_for_test_method_in_method_visibility_should_be_public_proc = -> do + MethodInMethodClass_Setup = -> do remove_const :MethodInMethodClass if defined? MethodInMethodClass class MethodInMethodClass @@ -1121,12 +1121,8 @@ class TestMethod < Test::Unit::TestCase end end - define_method :setup_for_test_method_in_method_visibility_should_be_public do - setup_for_test_method_in_method_visibility_should_be_public_proc.call - end - def test_method_in_method_visibility_should_be_public - setup_for_test_method_in_method_visibility_should_be_public + MethodInMethodClass_Setup.call assert_equal([:m1].sort, MethodInMethodClass.public_instance_methods(false).sort) assert_equal([].sort, MethodInMethodClass.private_instance_methods(false).sort) |