From 91b106fe4b6473e0a1bc3a021d279ddc52bc7de6 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 13 Jun 2023 12:02:22 +0100 Subject: [PATCH] [ruby/irb] Stanardise test class names with `Test` postfix instead of prefix (https://github.com/ruby/irb/pull/603) https://github.com/ruby/irb/commit/359cb28def --- test/irb/test_color.rb | 2 +- test/irb/test_color_printer.rb | 4 ++-- test/irb/test_completion.rb | 12 ++++++------ test/irb/test_context.rb | 2 +- test/irb/test_history.rb | 2 +- test/irb/test_init.rb | 2 +- test/irb/test_input_method.rb | 2 +- test/irb/test_option.rb | 2 +- test/irb/test_raise_no_backtrace_exception.rb | 2 +- test/irb/test_ruby_lex.rb | 2 +- test/irb/test_workspace.rb | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index 652396c89e887e..c9d2512dc51749 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -6,7 +6,7 @@ require_relative "helper" module TestIRB - class TestColor < TestCase + class ColorTest < TestCase CLEAR = "\e[0m" BOLD = "\e[1m" UNDERLINE = "\e[4m" diff --git a/test/irb/test_color_printer.rb b/test/irb/test_color_printer.rb index a717940d8186e0..f162b88548b431 100644 --- a/test/irb/test_color_printer.rb +++ b/test/irb/test_color_printer.rb @@ -6,7 +6,7 @@ require_relative "helper" module TestIRB - class TestColorPrinter < TestCase + class ColorPrinterTest < TestCase CLEAR = "\e[0m" BOLD = "\e[1m" RED = "\e[31m" @@ -41,7 +41,7 @@ def test_color_printer { 1 => "#{BLUE}#{BOLD}1#{CLEAR}\n", "a\nb" => %[#{RED}#{BOLD}"#{CLEAR}#{RED}a\\nb#{CLEAR}#{RED}#{BOLD}"#{CLEAR}\n], - IRBTestColorPrinter.new('test') => "#{GREEN}##{CLEAR}\n", + IRBTestColorPrinter.new('test') => "#{GREEN}##{CLEAR}\n", Ripper::Lexer.new('1').scan => "[#{GREEN}##{CLEAR}]\n", Class.new{define_method(:pretty_print){|q| q.text("[__FILE__, __LINE__, __ENCODING__]")}}.new => "[#{CYAN}#{BOLD}__FILE__#{CLEAR}, #{CYAN}#{BOLD}__LINE__#{CLEAR}, #{CYAN}#{BOLD}__ENCODING__#{CLEAR}]\n", }.each do |object, result| diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb index 8cd14fed52b351..2a659818e37f31 100644 --- a/test/irb/test_completion.rb +++ b/test/irb/test_completion.rb @@ -5,13 +5,13 @@ require_relative "helper" module TestIRB - class TestCompletion < TestCase + class CompletionTest < TestCase def setup # make sure require completion candidates are not cached IRB::InputCompletor.class_variable_set(:@@files_from_load_path, nil) end - class TestMethodCompletion < TestCompletion + class MethodCompletionTest < CompletionTest def test_complete_string assert_include(IRB::InputCompletor.retrieve_completion_data("'foo'.up", bind: binding), "'foo'.upcase") # completing 'foo bar'.up @@ -65,7 +65,7 @@ def test_complete_class end end - class TestRequireComepletion < TestCompletion + class RequireComepletionTest < CompletionTest def test_complete_require candidates = IRB::InputCompletor::CompletionProc.("'irb", "require ", "") %w['irb/init 'irb/ruby-lex].each do |word| @@ -139,7 +139,7 @@ def test_complete_require_relative end end - class TestVariableCompletion < TestCompletion + class VariableCompletionTest < CompletionTest def test_complete_variable # Bug fix issues https://github.com/ruby/irb/issues/368 # Variables other than `str_example` and `@str_example` are defined to ensure that irb completion does not cause unintended behavior @@ -181,7 +181,7 @@ def test_complete_sort_variables end end - class TestConstantCompletion < TestCompletion + class ConstantCompletionTest < CompletionTest class Foo B3 = 1 B1 = 1 @@ -198,7 +198,7 @@ def test_complete_constants end end - class TestPerfectMatching < TestCompletion + class PerfectMatchingTest < CompletionTest def setup # trigger PerfectMatchedProc to set up RDocRIDriver constant IRB::InputCompletor::PerfectMatchedProc.("foo", bind: binding) diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index c4ca56aba60d2a..5efbf045f2662b 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -6,7 +6,7 @@ require_relative "helper" module TestIRB - class TestContext < TestCase + class ContextTest < TestCase def setup IRB.init_config(nil) IRB.conf[:USE_SINGLELINE] = false diff --git a/test/irb/test_history.rb b/test/irb/test_history.rb index c74a3a2cb92d2b..fc81d53005b9c1 100644 --- a/test/irb/test_history.rb +++ b/test/irb/test_history.rb @@ -6,7 +6,7 @@ require_relative "helper" module TestIRB - class TestHistory < TestCase + class HistoryTest < TestCase def setup IRB.conf[:RC_NAME_GENERATOR] = nil end diff --git a/test/irb/test_init.rb b/test/irb/test_init.rb index d9e338da8d2863..9f3f2a10987c20 100644 --- a/test/irb/test_init.rb +++ b/test/irb/test_init.rb @@ -5,7 +5,7 @@ require_relative "helper" module TestIRB - class TestInit < TestCase + class InitTest < TestCase def setup # IRBRC is for RVM... @backup_env = %w[HOME XDG_CONFIG_HOME IRBRC].each_with_object({}) do |env, hash| diff --git a/test/irb/test_input_method.rb b/test/irb/test_input_method.rb index fdfb5663905a66..ea7efb5dd51160 100644 --- a/test/irb/test_input_method.rb +++ b/test/irb/test_input_method.rb @@ -5,7 +5,7 @@ require_relative "helper" module TestIRB - class TestRelineInputMethod < TestCase + class RelineInputMethodTest < TestCase def setup @conf_backup = IRB.conf.dup IRB.conf[:LC_MESSAGES] = IRB::Locale.new diff --git a/test/irb/test_option.rb b/test/irb/test_option.rb index e334cee6dd39a6..fec31f384f96fe 100644 --- a/test/irb/test_option.rb +++ b/test/irb/test_option.rb @@ -2,7 +2,7 @@ require_relative "helper" module TestIRB - class TestOption < TestCase + class OptionTest < TestCase def test_end_of_option bug4117 = '[ruby-core:33574]' bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] diff --git a/test/irb/test_raise_no_backtrace_exception.rb b/test/irb/test_raise_no_backtrace_exception.rb index 9565419cdd0d64..929577ad8e1060 100644 --- a/test/irb/test_raise_no_backtrace_exception.rb +++ b/test/irb/test_raise_no_backtrace_exception.rb @@ -4,7 +4,7 @@ require_relative "helper" module TestIRB - class TestRaiseNoBacktraceException < TestCase + class RaiseNoBacktraceExceptionTest < TestCase def test_raise_exception bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] assert_in_out_err(bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<-IRB, /Exception: foo/, []) diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb index 1530a16d6aef11..aa27204e26dea4 100644 --- a/test/irb/test_ruby_lex.rb +++ b/test/irb/test_ruby_lex.rb @@ -6,7 +6,7 @@ require_relative "helper" module TestIRB - class TestRubyLex < TestCase + class RubyLexTest < TestCase Row = Struct.new(:content, :current_line_spaces, :new_line_spaces, :nesting_level) class MockIO_AutoIndent diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb index c6b8aa1e99d04f..ff17b1a22ced4b 100644 --- a/test/irb/test_workspace.rb +++ b/test/irb/test_workspace.rb @@ -8,7 +8,7 @@ require_relative "helper" module TestIRB - class TestWorkSpace < TestCase + class WorkSpaceTest < TestCase def test_code_around_binding IRB.conf[:USE_COLORIZE] = false Tempfile.create('irb') do |f|