aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-12-20 19:44:56 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-12-20 19:45:25 +0900
commit1c72c95d999040dbe9399d3687d8e52f654aa5bf (patch)
tree208588dbb62ac57e69d850b38d2445db88dbd280
parent26c9ef6a890f0d4e51caefd303fd93356bb4d596 (diff)
downloadruby-1c72c95d999040dbe9399d3687d8e52f654aa5bf.tar.gz
test/ruby/test_ast.rb: Avoid a "method redefined" warning
-rw-r--r--test/ruby/test_ast.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 63362096f9..ce0942a6fb 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -258,25 +258,25 @@ class TestAst < Test::Unit::TestCase
keep_script_lines_back = RubyVM.keep_script_lines
RubyVM.keep_script_lines = true
- method = self.method(eval("def example_method_#{$$}; end"))
+ method = self.method(eval("def example_method_#{$$}_with_keep_script_lines; end"))
assert_instance_of(RubyVM::AbstractSyntaxTree::Node, RubyVM::AbstractSyntaxTree.of(method))
- method = self.method(eval("def self.example_singleton_method_#{$$}; end"))
+ method = self.method(eval("def self.example_singleton_method_#{$$}_with_keep_script_lines; end"))
assert_instance_of(RubyVM::AbstractSyntaxTree::Node, RubyVM::AbstractSyntaxTree.of(method))
method = eval("proc{}")
assert_instance_of(RubyVM::AbstractSyntaxTree::Node, RubyVM::AbstractSyntaxTree.of(method))
- method = self.method(eval("singleton_class.define_method(:example_define_method_#{$$}){}"))
+ method = self.method(eval("singleton_class.define_method(:example_define_method_#{$$}_with_keep_script_lines){}"))
assert_instance_of(RubyVM::AbstractSyntaxTree::Node, RubyVM::AbstractSyntaxTree.of(method))
- method = self.method(eval("define_singleton_method(:example_dsm_#{$$}){}"))
+ method = self.method(eval("define_singleton_method(:example_dsm_#{$$}_with_keep_script_lines){}"))
assert_instance_of(RubyVM::AbstractSyntaxTree::Node, RubyVM::AbstractSyntaxTree.of(method))
- method = eval("Class.new{def example_method; end}.instance_method(:example_method)")
+ method = eval("Class.new{def example_method_with_keep_script_lines; end}.instance_method(:example_method_with_keep_script_lines)")
assert_instance_of(RubyVM::AbstractSyntaxTree::Node, RubyVM::AbstractSyntaxTree.of(method))
- method = eval("Class.new{def example_method; end}.instance_method(:example_method)")
+ method = eval("Class.new{def example_method_with_keep_script_lines; end}.instance_method(:example_method_with_keep_script_lines)")
assert_instance_of(RubyVM::AbstractSyntaxTree::Node, RubyVM::AbstractSyntaxTree.of(method))
ensure