Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build error when using Ruby 2.8.0-dev
This PR fixes the following build error when using Ruby 2.8.0-dev. ```console % ruby -v ruby 2.8.0dev (2020-07-14T04:19:55Z master e60cd14d85) [x86_64-darwin17] % bundle exec rspec ./spec/rubocop/cop/lint/redundant_cop_disable_directive_spec.rb:47 Run options: include {:focus=>true, :locations=>{"./spec/rubocop/cop/lint/redundant_cop_disable_directive_spec.rb"=>[47]}} Randomized with seed 2998 F Failures: 1) RuboCop::Cop::Lint::RedundantCopDisableDirective.check when there are disabled lines and there are no offenses and a comment disables itself and another cop disabled on the same range returns no offense Failure/Error: range.cover?(line_range.min) && range.cover?(line_range.max) FloatDomainError: Infinity # ./lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:164:in `floor' # ./lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:164:in `max' # ./lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:164:in `block in ignore_offense?' # ./lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:163:in `any?' # ./lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:163:in `ignore_offense?' # ./lib/rubocop/cop/lint/redundant_cop_disable_directive.rb:110:in `block in each_line_range' ``` The above error is due to the following Ruby 2.8.0-dev's changeset. ruby/ruby@8900a25 ## Ruby 2.7.1 ``` % ruby -ve 'p (42..Float::INFINITY).max' ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin17] Infinity ``` ## Ruby 2.8.0-dev ```console % ruby -ve '(42..Float::INFINITY).max' ruby 2.8.0dev (2020-07-14T04:19:55Z master e60cd14d85) [x86_64-darwin17] -e:1:in `floor': Infinity (FloatDomainError) from -e:1:in `max' from -e:1:in `<main>' ``` I asked the following address and it's an expected behaviour. https://bugs.ruby-lang.org/issues/17017 Perhaps there is still a possibility that the behavior will change while Ruby 2.8 (3.0) is being developed. First of all, this PR is updating according to the current expectation.
- Loading branch information