From 39d4ac281ebe93ab9a74f2a1cc89331b9cd9f715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20Barr=C3=A8re?= Date: Tue, 27 Dec 2022 11:19:01 +0100 Subject: [PATCH] Add Ruby 3.2 to the test matrix (& CI fixes) (#102) * Add Ruby 3.2 to CI matrix * Bump Ruby for StandardRB check * Add temporary fix for https://github.com/rubocop/rubocop/issues/10675 * Add rubocop fixes --- .github/workflows/ci.yml | 3 ++- kiba.gemspec | 4 +++- test/test_integration.rb | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49b79fe..c6236cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: - '2.7' - '3.0' - '3.1' + - '3.2' - head - jruby - jruby-head @@ -27,7 +28,7 @@ jobs: - run: bundle exec rake # NOTE: calling "bundle install" because the cache apparently did not update due to the gemspec injection - run: bundle install && bundle exec standardrb - if: matrix.ruby == '3.1' # not using "head" because rubocop won't work there yet + if: matrix.ruby == '3.2' # not using "head" because rubocop won't work there yet # What's below helps having a single "status check" for mergeability, without # having to add each new version to the list of expected status checks in GitHub. # See https://github.community/t/status-check-for-a-matrix-jobs/127354/7 diff --git a/kiba.gemspec b/kiba.gemspec index 63ba534..7322e27 100644 --- a/kiba.gemspec +++ b/kiba.gemspec @@ -7,7 +7,9 @@ Gem::Specification.new do |gem| gem.homepage = "https://www.kiba-etl.org" gem.license = "LGPL-3.0" gem.files = `git ls-files | grep -Ev '^(examples)'`.split("\n") - gem.test_files = `git ls-files -- test/*`.split("\n") + # NOTE: temporarily disabled until + # https://github.com/rubocop/rubocop/issues/10675 is fixed + # gem.test_files = `git ls-files -- test/*`.split("\n") gem.name = "kiba" gem.require_paths = ["lib"] gem.version = Kiba::VERSION diff --git a/test/test_integration.rb b/test/test_integration.rb index e910a1c..6fcc74c 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -46,16 +46,16 @@ def test_csv_to_csv transform do |row| row[:sex] = case row[:sex] - when "M" then "Male" - when "F" then "Female" - else "Unknown" + when "M" then "Male" + when "F" then "Female" + else "Unknown" end row # must be returned end # returning nil dismisses the row transform do |row| - row[:sex] == "Female" ? row : nil + (row[:sex] == "Female") ? row : nil end transform TestRenameFieldTransform, :sex, :sex_2015