66# Needs Prism.parse_file(file, version: "current")
77return if RUBY_VERSION < "3.3"
88
9+ require_relative 'inline_method'
10+
911module Prism
1012 class NodeForTest < TestCase
1113 INDENT = ' ' * 4
@@ -15,9 +17,6 @@ def m(foo)
1517 end
1618 M_LOCATION = [ __LINE__ -3 , 4 , __LINE__ -1 , 7 ]
1719
18- def inline_method = 42
19- INLINE_LOCATION = [ __LINE__ -1 , 4 , __LINE__ -1 , 26 ]
20-
2120 define_method ( :define_method_method ) { 42 }
2221 DEFINE_METHOD_LOCATION = [ __LINE__ -1 , 41 , __LINE__ -1 , 47 ]
2322
@@ -44,7 +43,7 @@ def test_def_method
4443 end
4544
4645 def test_inline_method
47- node = Prism . node_for ( with_location ( method ( :inline_method ) , INLINE_LOCATION ) )
46+ node = Prism . node_for ( with_location ( method ( :inline_method ) , * INLINE_LOCATION_AND_FILE ) )
4847 assert_instance_of ( Prism ::DefNode , node )
4948 assert_equal "def inline_method = 42" , node . slice
5049 end
@@ -89,7 +88,7 @@ def test_proc
8988 end
9089
9190 def test_method_to_proc
92- node = Prism . node_for ( with_location ( method ( :inline_method ) . to_proc , INLINE_LOCATION ) )
91+ node = Prism . node_for ( with_location ( method ( :inline_method ) . to_proc , * INLINE_LOCATION_AND_FILE ) )
9392 assert_instance_of ( Prism ::DefNode , node )
9493 assert_equal "def inline_method = 42" , node . slice
9594 end
0 commit comments