diff --git a/test/assertion_helper_test.rb b/test/assertion_helper_test.rb index 88138f2bc..b75b2b716 100644 --- a/test/assertion_helper_test.rb +++ b/test/assertion_helper_test.rb @@ -6,7 +6,7 @@ module DEBUGGER__ class AssertLineTextTest < TestCase def program <<~RUBY - a = 1 + 1| a = 1 RUBY end diff --git a/test/support/test_case.rb b/test/support/test_case.rb index e2163d471..c9ca263e2 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -16,7 +16,7 @@ def teardown end def remove_temp_file - File.unlink(@temp_file) + File.unlink(@temp_file) if @temp_file @temp_file = nil end diff --git a/test/support/utils.rb b/test/support/utils.rb index 5a211c29f..b1382121d 100644 --- a/test/support/utils.rb +++ b/test/support/utils.rb @@ -16,6 +16,8 @@ def create_message fail_msg # This method will execute both local and remote mode by default. def debug_code(program, boot_options: '-r debug/run', remote: true, &block) + check_line_num!(program) + @scenario = block write_temp_file(strip_line_num(program)) inject_lib_to_load_path @@ -29,15 +31,12 @@ def debug_code(program, boot_options: '-r debug/run', remote: true, &block) debug_on_unix_domain_socket debug_on_tcpip end - - check_line_num!(program) end - DEBUG_MODE = false ASK_CMD = %w[quit delete kill undisplay] def debug_print msg - print msg if DEBUG_MODE + print msg if ENV['RUBY_DEBUG_TEST_DEBUG_MODE'] end RUBY = RbConfig.ruby diff --git a/test/test_utils_test.rb b/test/test_utils_test.rb index 9241e79a7..cfce86d44 100644 --- a/test/test_utils_test.rb +++ b/test/test_utils_test.rb @@ -6,7 +6,7 @@ module DEBUGGER__ class PseudoTerminalTest < TestCase def program <<~RUBY - a = 1 + 1| a = 1 RUBY end