Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stanardise test class names with Test postfix instead of prefix #603

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/irb/test_color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require_relative "helper"

module TestIRB
class TestColor < TestCase
class ColorTest < TestCase
CLEAR = "\e[0m"
BOLD = "\e[1m"
UNDERLINE = "\e[4m"
Expand Down
4 changes: 2 additions & 2 deletions test/irb/test_color_printer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require_relative "helper"

module TestIRB
class TestColorPrinter < TestCase
class ColorPrinterTest < TestCase
CLEAR = "\e[0m"
BOLD = "\e[1m"
RED = "\e[31m"
Expand Down Expand Up @@ -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}#<struct TestIRB::TestColorPrinter::IRBTestColorPrinter#{CLEAR} a#{GREEN}=#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}#{RED}test#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}#{GREEN}>#{CLEAR}\n",
IRBTestColorPrinter.new('test') => "#{GREEN}#<struct TestIRB::ColorPrinterTest::IRBTestColorPrinter#{CLEAR} a#{GREEN}=#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}#{RED}test#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}#{GREEN}>#{CLEAR}\n",
Ripper::Lexer.new('1').scan => "[#{GREEN}#<Ripper::Lexer::Elem:#{CLEAR} on_int@1:0 END token: #{RED}#{BOLD}\"#{CLEAR}#{RED}1#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}#{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|
Expand Down
12 changes: 6 additions & 6 deletions test/irb/test_completion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand 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|
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -181,7 +181,7 @@ def test_complete_sort_variables
end
end

class TestConstantCompletion < TestCompletion
class ConstantCompletionTest < CompletionTest
class Foo
B3 = 1
B1 = 1
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require_relative "helper"

module TestIRB
class TestHistory < TestCase
class HistoryTest < TestCase
def setup
IRB.conf[:RC_NAME_GENERATOR] = nil
end
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_input_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_option.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'] : []
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_raise_no_backtrace_exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/, [])
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_ruby_lex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/irb/test_workspace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down