From 4c620495f915fef39d1583170beb6489d0c7073d Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 14 May 2024 19:41:30 -0700 Subject: [PATCH] fix: Fixed minitest version failures in the system test builtin tool (#259) --- .github/workflows/ci.yml | 2 +- toys/builtins/system/test.rb | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2ec7970..131c8d35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: ruby: "truffleruby" tool: test - os: macos-latest - ruby: "2.4" + ruby: "2.6" tool: test - os: macos-latest ruby: "3.3" diff --git a/toys/builtins/system/test.rb b/toys/builtins/system/test.rb index a313e4dd..0b47cdd5 100644 --- a/toys/builtins/system/test.rb +++ b/toys/builtins/system/test.rb @@ -45,12 +45,12 @@ def load_minitest_gems gem "minitest", minitest_version require "minitest" if minitest_focus - minitest_focus = "~> 1.0" if minitest_focus == true + set :minitest_focus, "~> 1.0" if minitest_focus == true gem "minitest-focus", minitest_focus require "minitest/focus" end if minitest_rg - minitest_rg = "~> 5.0" if minitest_rg == true + set :minitest_rg, "~> 5.0" if minitest_rg == true gem "minitest-rg", minitest_rg require "minitest/rg" end @@ -82,14 +82,15 @@ def ruby_args def ruby_code code = [] - code << "gem 'minitest', '= #{::Minitest::VERSION}'" + code << "gem 'minitest', #{minitest_version.inspect}" code << "require 'minitest/autorun'" if minitest_focus code << "gem 'minitest-focus', '= #{::Minitest::Test::Focus::VERSION}'" code << "require 'minitest/focus'" end if minitest_rg - code << "gem 'minitest-rg', '= #{::MiniTest::RG::VERSION}'" + version = defined?(::Minitest::RG::VERSION) ? ::Minitest::RG::VERSION : ::MiniTest::RG::VERSION + code << "gem 'minitest-rg', '= #{version}'" code << "require 'minitest/rg'" end code << "require 'toys'"