From c77407d76e446e85c8c501b812149bdc98ac2200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20Barr=C3=A8re?= Date: Fri, 8 Nov 2024 07:37:39 +0100 Subject: [PATCH] Fix standardrb errors + minitest references in tests (#104) * Fix minitest references in tests * trigger CI * bundle exec standardrb --fix * bundle exec standardrb --fix * Add missing dev dependency for Ruby 3.4 support --- kiba.gemspec | 1 + test/helper.rb | 2 +- test/shared_runner_tests.rb | 10 +++++----- test/support/shared_tests.rb | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/kiba.gemspec b/kiba.gemspec index 7322e27..9b65814 100644 --- a/kiba.gemspec +++ b/kiba.gemspec @@ -23,4 +23,5 @@ Gem::Specification.new do |gem| gem.add_development_dependency "awesome_print" gem.add_development_dependency "minitest-focus" gem.add_development_dependency "standard" + gem.add_development_dependency "csv" end diff --git a/test/helper.rb b/test/helper.rb index 222ebe5..ead7a86 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -4,7 +4,7 @@ require "kiba" if ENV["CI"] == "true" - puts "Running with MiniTest version #{MiniTest::VERSION}" + puts "Running with Minitest version #{Minitest::VERSION}" end class Kiba::Test < Minitest::Test diff --git a/test/shared_runner_tests.rb b/test/shared_runner_tests.rb index d9f93a2..65770c8 100644 --- a/test/shared_runner_tests.rb +++ b/test/shared_runner_tests.rb @@ -64,7 +64,7 @@ def test_pre_process_runs_once def test_pre_process_runs_before_source_is_instantiated calls = [] - mock_source_class = MiniTest::Mock.new + mock_source_class = Minitest::Mock.new mock_source_class.expect(:new, TestEnumerableSource.new([1, 2, 3])) do calls << :source_instantiated end @@ -80,9 +80,9 @@ def test_pre_process_runs_before_source_is_instantiated def test_no_error_raised_if_destination_close_not_implemented # NOTE: this fake destination does not implement `close` - destination_instance = MiniTest::Mock.new + destination_instance = Minitest::Mock.new - mock_destination_class = MiniTest::Mock.new + mock_destination_class = Minitest::Mock.new mock_destination_class.expect(:new, destination_instance) control = Kiba::Control.new @@ -92,9 +92,9 @@ def test_no_error_raised_if_destination_close_not_implemented end def test_destination_close_called_if_defined - destination_instance = MiniTest::Mock.new + destination_instance = Minitest::Mock.new destination_instance.expect(:close, nil) - mock_destination_class = MiniTest::Mock.new + mock_destination_class = Minitest::Mock.new mock_destination_class.expect(:new, destination_instance) control = Kiba::Control.new diff --git a/test/support/shared_tests.rb b/test/support/shared_tests.rb index 1ee01d7..32facdf 100644 --- a/test/support/shared_tests.rb +++ b/test/support/shared_tests.rb @@ -4,7 +4,7 @@ def shared_tests_for(desc, &block) @@shared_tests[desc] = block end - def shared_tests(desc, *args) - class_exec(*args, &@@shared_tests.fetch(desc)) + def shared_tests(desc, *) + class_exec(*, &@@shared_tests.fetch(desc)) end end