Skip to content

Commit

Permalink
Avoid breaking change in psych v4 in ruby v3.1
Browse files Browse the repository at this point in the history
ruby 3.1 was shipped with psych v4 which included a breaking change [1]
that was mentioned in the ruby v3.1 release notes [2] (see the "Other
notable changes since 3.0" section).

This commit constrains psych to < v4. I haven't investigated, but I
suspect the code using psych is in rubocop, so we might be able to avoid
adding this constraint if we update to a more recent version of rubocop.

[1]: https://bugs.ruby-lang.org/issues/17866
[2]: https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/
  • Loading branch information
floehopper authored Jan 11, 2022
1 parent 191823e commit 08b9f4c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mocha.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
end

s.add_development_dependency('introspection', '~> 0.0.1')

# Avoid breaking change in psych v4 (https://bugs.ruby-lang.org/issues/17866)
if RUBY_VERSION >= '3.1.0'
s.add_development_dependency('psych', '< 4')
end

if RUBY_VERSION >= '2.2.0'
# No test libraries in standard library
s.add_development_dependency('minitest')
Expand Down

0 comments on commit 08b9f4c

Please sign in to comment.