Skip to content

Commit

Permalink
Fix standardrb errors + minitest references in tests (#104)
Browse files Browse the repository at this point in the history
* Fix minitest references in tests

* trigger CI

* bundle exec standardrb --fix

* bundle exec standardrb --fix

* Add missing dev dependency for Ruby 3.4 support
  • Loading branch information
thbar authored Nov 8, 2024
1 parent 39d4ac2 commit c77407d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions kiba.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions test/shared_runner_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/support/shared_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c77407d

Please sign in to comment.