Skip to content

Commit 0f542ea

Browse files
etagwerkerclaude
andauthored
ci: test against Ruby 4.0 and ruby-head (#133)
* ci: test against Ruby 3.5 and ruby-head Extend the CI matrix to cover newer Ruby versions so we catch incompatibilities early. Adds Ruby 3.5 to the supported matrix and a non-blocking ruby-head build (continue-on-error) to surface upcoming breakage without failing the suite. Also sets fail-fast: false so one version failing doesn't cancel the rest of the matrix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: target Ruby 4.0 stable instead of 3.5 Ruby 3.5 never shipped as a stable release; the December 2025 release was branded Ruby 4.0. Point the matrix at the actual current stable (4.0) instead of the 3.5 preview line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * deps: support Ruby 4.0 (ostruct, terminal-table 4.0, loosen linters) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * deps: keep terminal-table ~> 3.0 for Ruby 2.6/2.7 compatibility terminal-table 4.0 requires unicode-display_width ~> 3.0, which conflicts with every rubocop that still supports Ruby 2.7 (needs < 3.0). Bundler silently backtracked rubocop to 0.7.2, which lacks rubocop/rake_task and broke the suite on 2.6/2.7. terminal-table 3.x works on Ruby 4.0, so the 4.0 bump was unnecessary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test: reset Skunk::Config to fix order-dependent formats test Skunk::Config is a process-global singleton. config_test.rb mutated Config.formats but only reset in setup, so it leaked [:html, :json] into other files. Under minitest's randomized order this intermittently failed argv_test.rb's 'defaults to console format' expectation (seen on the Ruby 3.2 CI job). Reset Config in config_test teardown and before/after the argv formats tests so the suite is order-independent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6c28a2b commit 0f542ea

5 files changed

Lines changed: 20 additions & 4 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ on: [push, pull_request]
66
jobs:
77
test-ruby:
88
runs-on: ${{ matrix.os }}-latest
9+
continue-on-error: ${{ matrix.experimental || false }}
910
strategy:
11+
fail-fast: false
1012
matrix:
1113
os: [ubuntu]
12-
ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
14+
ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0"]
15+
include:
16+
- os: ubuntu
17+
ruby-version: "head"
18+
experimental: true
1319
steps:
1420
- uses: actions/checkout@v2
1521
- name: Setup Ruby ${{ matrix.ruby-version }}

‎Gemfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
77
# Specify your gem's dependencies in skunk.gemspec
88
gemspec
99

10-
gem "reek", "~> 6.1"
11-
gem "rubocop", "~> 1.48"
10+
gem "reek"
11+
gem "rubocop"

‎skunk.gemspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ Gem::Specification.new do |spec|
3838
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
3939
spec.require_paths = ["lib"]
4040

41+
spec.add_dependency "ostruct", "~> 0.6"
4142
spec.add_dependency "path_expander", "< 2.0"
4243
spec.add_dependency "rubycritic", ">= 4.5.2", "< 5.0"
4344
spec.add_dependency "terminal-table", "~> 3.0"
4445

4546
spec.add_development_dependency "codecov", "~> 0.1.16"
46-
spec.add_development_dependency "debug"
4747
spec.add_development_dependency "minitest", "< 6"
4848
spec.add_development_dependency "minitest-around", "~> 0.5.0"
4949
spec.add_development_dependency "minitest-stub_any_instance", "~> 1.0.2"

‎test/lib/skunk/cli/options/argv_test.rb‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
end
2727

2828
describe "#formats" do
29+
before do
30+
Skunk::Config.reset
31+
end
32+
2933
after do
3034
Skunk::Config.reset
3135
end

‎test/lib/skunk/config_test.rb‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ def setup
1111
Config.reset
1212
end
1313

14+
# Reset again after each test so the global singleton does not leak
15+
# mutated formats into tests in other files (minitest randomizes order)
16+
def teardown
17+
Config.reset
18+
end
19+
1420
def test_default_format
1521
assert_equal [:console], Config.formats
1622
end

0 commit comments

Comments
 (0)