Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly detect Rails version when using only parts of the framework
Follow up rubocop/rubocop#11289. This commit fixes the following failed tests. ```console % bundle exec rake (snip) Failures: 1) RuboCop::Config#target_rails_version when TargetRailsVersion is not set and gems.locked exists uses the single digit Rails version in gems.locked Failure/Error: expect(configuration.target_rails_version).to eq 4.1 expected: 4.1 got: 5.0 (compared using ==) # ./spec/rubocop/config_spec.rb:88:in `block (6 levels) in <top (required)>' 2) RuboCop::Config#target_rails_version when TargetRailsVersion is not set and gems.locked exists uses the multi digit Rails version in gems.locked Failure/Error: expect(configuration.target_rails_version).to eq 400.33 expected: 400.33 got: 5.0 (compared using ==) # ./spec/rubocop/config_spec.rb:122:in `block (6 levels) in <top (required)>' 3) RuboCop::Config#target_rails_version when TargetRailsVersion is not set and Gemfile.lock exists uses the multi digit Rails version in Gemfile.lock Failure/Error: expect(configuration.target_rails_version).to eq 400.33 expected: 400.33 got: 5.0 (compared using ==) # ./spec/rubocop/config_spec.rb:122:in `block (6 levels) in <top (required)>' 4) RuboCop::Config#target_rails_version when TargetRailsVersion is not set and Gemfile.lock exists uses the single digit Rails version in Gemfile.lock Failure/Error: expect(configuration.target_rails_version).to eq 4.1 expected: 4.1 got: 5.0 (compared using ==) # ./spec/rubocop/config_spec.rb:88:in `block (6 levels) in <top (required)>' Finished in 0.05343 seconds (files took 1.28 seconds to load) 11 examples, 4 failures Failed examples: rspec './spec/rubocop/config_spec.rb[1:1:2:3:1]' # RuboCop::Config#target_rails_version when TargetRailsVersion is not set and gems.locked exists uses the single digit Rails version in gems.locked rspec './spec/rubocop/config_spec.rb[1:1:2:3:2]' # RuboCop::Config#target_rails_version when TargetRailsVersion is not set and gems.locked exists uses the multi digit Rails version in gems.locked rspec './spec/rubocop/config_spec.rb[1:1:2:2:2]' # RuboCop::Config#target_rails_version when TargetRailsVersion is not set and Gemfile.lock exists uses the multi digit Rails version in Gemfile.lock rspec './spec/rubocop/config_spec.rb[1:1:2:2:1]' # RuboCop::Config#target_rails_version when TargetRailsVersion is not set and Gemfile.lock exists uses the single digit Rails version in Gemfile.lock ```
- Loading branch information