dgollahon / rspectre

Exorcise the apparitions haunting your tests.
MIT License
75 stars 10 forks source link

Fix a dependency #42

Closed chiastolite closed 3 years ago

chiastolite commented 3 years ago

Reproduction script

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'

  gem 'parser', '2.4.0.2'
  gem 'rspectre'
end

This causes the following error.

/Users/chiastolite/.anyenv/envs/rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/rspectre-0.0.3/lib/rspectre/auto_corrector.rb:4:in `<module:RSpectre>': uninitialized constant Parser::TreeRewriter (NameError)

Because Parser::TreeRewriter is available since parser 2.5.0 or later.

This is related to #21

dgollahon commented 3 years ago

Hi @chiastolite, thanks for the PR--good catch.

Looks like my CI has rusted so I may have to take a few minutes to fix that. I will try to fix the build and cut a release sometime soon.

bquorning commented 3 years ago

Actually, could we make it possible to bundle with parser 3.x as well? I don't think RSpectre uses any of the parser 2.x-specific APIs.

dgollahon commented 3 years ago

Actually, could we make it possible to bundle with parser 3.x as well? I don't think RSpectre uses any of the parser 2.x-specific APIs.

Yeah, that probably makes sense 👍 parser is kind of odd to choose a range for since it's not traditional semver. I guess we want > 2.5 and maybe or maybe not < 4 (though that probably doesn't matter since we won't have a ruby 4 for who knows how long unless they change the versioning scheme)?

dgollahon commented 3 years ago

Closing this in favor of #43 since the external commit didn't build (this config should be fixed) and I wanted to adjust the constraint a bit. Thanks for the report!