Skip to content

Add Appraisals to test against multiple json gem versions - #114

Merged
dblock merged 1 commit into
masterfrom
appraisals-json
Sep 12, 2026
Merged

dblock merged 1 commit into
masterfrom
appraisals-json

Conversation

@dblock

@dblock dblock commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Description

Adds an Appraisal-based test matrix (json-2, json-3) so the existing spec suite can be run against both json < 3.0 (currently supported) and json >= 3.0, to reproduce and track #113.

json 3.0 changed JSON.parse to keyword-only options, dropping the positional options hash form that Faraday's :json response middleware relies on. As a result, any Strava API response parsed through Faraday's JSON middleware fails with:

Faraday::ParsingError: wrong number of arguments (given 2, expected 1)

Changes

  • Adds appraisal gem and an Appraisals file defining json-2 and json-3 appraisals.
  • Moves rubocop, rubocop-rake, and rubocop-rspec out of the main Gemfile into their own gemfiles/rubocop.gemfile, since rubocop < 1.90 pins json ~> 2.3, which otherwise made it impossible to resolve a Gemfile that also depends on json ~> 3.0.
  • Updates the Rakefile default task and .github/workflows/rubocop.yml to use gemfiles/rubocop.gemfile via BUNDLE_GEMFILE.
  • Adds an appraisals CI job in .github/workflows/test.yml that runs rake spec against the json-2 gemfile. The json-3 entry is present but commented out since it currently fails CI — it's there so it's easy to re-enable once the underlying incompatibility (tracked in Faraday::ParsingError with json gem >= 3.0 (ArgumentError: wrong number of arguments) #113) is fixed, or to run manually/locally.
  • Excludes generated gemfiles/*.gemfile from rubocop and gemfiles/*.gemfile.lock from git.
  • Documents the new workflow in CONTRIBUTING.md and CHANGELOG.md.

Verification

Ran locally:

BUNDLE_GEMFILE=gemfiles/json_2.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/json_2.gemfile bundle exec rake spec   # 338 examples, 0 failures

BUNDLE_GEMFILE=gemfiles/json_3.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/json_3.gemfile bundle exec rake spec   # 18 failures reproducing #113

BUNDLE_GEMFILE=gemfiles/rubocop.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/rubocop.gemfile bundle exec rubocop    # no offenses

Related to #113.

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@dblock
dblock force-pushed the appraisals-json branch 2 times, most recently from 08fa526 to f8735b8 Compare September 12, 2026 17:03
Adds an Appraisal-based test matrix (json-2, json-3) run in CI so the
existing spec suite is exercised against both the currently supported
json < 3.0 and json >= 3.0, reproducing the Faraday::ParsingError /
ArgumentError described in #113 whenever json 3.x is resolved.

- Add 'appraisal' gem and an Appraisals file defining 'json-2' and
  'json-3' appraisals.
- Move rubocop, rubocop-rake, and rubocop-rspec out of the main Gemfile
  into their own gemfiles/rubocop.gemfile, since rubocop < 1.90 pins
  json ~> 2.3, which otherwise made it impossible to resolve a Gemfile
  that also depends on json ~> 3.0.
- Update the Rakefile default task and .github/workflows/rubocop.yml to
  use gemfiles/rubocop.gemfile via BUNDLE_GEMFILE.
- Add a CI job in .github/workflows/test.yml that runs 'rake spec'
  against each appraisal gemfile; the json-3 job is currently expected
  to fail, tracking when the incompatibility is resolved.
- Exclude generated gemfiles/*.gemfile from rubocop and
  gemfiles/*.gemfile.lock from git.
- Document the new workflow in CONTRIBUTING.md and CHANGELOG.md.

Verified locally: the existing oauth/api/webhooks specs pass under
gemfiles/json_2.gemfile (0 failures) and fail under
gemfiles/json_3.gemfile with the exact reported error, reproducing
#113.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock merged commit 1193525 into master Sep 12, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant