From d6cb2dc6225dd544ca943e09df755a26324763a5 Mon Sep 17 00:00:00 2001 From: Jemma Issroff Date: Wed, 25 Oct 2023 14:14:43 -0300 Subject: [PRISM] Refactor tests to deconflict with existing tests --- test/ruby/test_compile_prism.rb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 8315ee4e3d..a5907e1e45 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -3,6 +3,8 @@ # This file is organized to match itemization in https://github.com/ruby/prism/issues/1335 module Prism class TestCompilePrism < Test::Unit::TestCase + # Subclass is used for tests which need it + class Subclass; end ############################################################################ # Literals # ############################################################################ @@ -599,19 +601,19 @@ module Prism def test_CallAndWriteNode test_prism_eval(<<-CODE - def Object.test_call_and_write_node; end; - Object.test_call_and_write_node &&= 1 + def Subclass.test_call_and_write_node; end; + Subclass.test_call_and_write_node &&= 1 CODE ) test_prism_eval(<<-CODE - def Object.test_call_and_write_node + def Subclass.test_call_and_write_node "str" end - def Object.test_call_and_write_node=(val) + def Subclass.test_call_and_write_node=(val) val end - Object.test_call_and_write_node &&= 1 + Subclass.test_call_and_write_node &&= 1 CODE ) @@ -635,19 +637,19 @@ module Prism def test_CallOrWriteNode test_prism_eval(<<-CODE - def Object.test_call_or_write_node; end; - def Object.test_call_or_write_node=(val) + def Subclass.test_call_or_write_node; end; + def Subclass.test_call_or_write_node=(val) val end - Object.test_call_or_write_node ||= 1 + Subclass.test_call_or_write_node ||= 1 CODE ) test_prism_eval(<<-CODE - def Object.test_call_or_write_node + def Subclass.test_call_or_write_node "str" end - Object.test_call_or_write_node ||= 1 + Subclass.test_call_or_write_node ||= 1 CODE ) @@ -671,13 +673,13 @@ module Prism def test_CallOperatorWriteNode test_prism_eval(<<-CODE - def Object.test_call_operator_write_node + def Subclass.test_call_operator_write_node 2 end - def Object.test_call_operator_write_node=(val) + def Subclass.test_call_operator_write_node=(val) val end - Object.test_call_operator_write_node += 1 + Subclass.test_call_operator_write_node += 1 CODE ) end -- cgit v1.2.3