Remove ruby 2.5 support (#1415)
* Remove Ruby 2.5 support * Setting the target Ruby version to 2.6 on Rubocop * Fix Style/SlicingWithRange: Prefer ary[n..] over ary[n..-1] offenses
This commit is contained in:
parent
c969f1d52f
commit
0cc461d4d9
|
@ -29,7 +29,6 @@ jobs:
|
||||||
ruby:
|
ruby:
|
||||||
- 2.7.2
|
- 2.7.2
|
||||||
- 2.6.6
|
- 2.6.6
|
||||||
- 2.5.8
|
|
||||||
appraisal:
|
appraisal:
|
||||||
- rails_6_0
|
- rails_6_0
|
||||||
- rails_5_2
|
- rails_5_2
|
||||||
|
|
|
@ -3,7 +3,7 @@ require:
|
||||||
- rubocop-rails
|
- rubocop-rails
|
||||||
AllCops:
|
AllCops:
|
||||||
NewCops: disable
|
NewCops: disable
|
||||||
TargetRubyVersion: 2.5
|
TargetRubyVersion: 2.6
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'gemfiles/*'
|
- 'gemfiles/*'
|
||||||
Bundler/OrderedGems:
|
Bundler/OrderedGems:
|
||||||
|
|
|
@ -468,7 +468,7 @@ machine, understanding the codebase, and creating a good pull request.
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
Shoulda Matchers is tested and supported against Ruby 2.5+, Rails
|
Shoulda Matchers is tested and supported against Ruby 2.6+, Rails
|
||||||
5.0+, RSpec 3.x, and Minitest 5.x.
|
5.0+, RSpec 3.x, and Minitest 5.x.
|
||||||
|
|
||||||
- For Ruby < 2.4 and Rails < 4.1 compatibility, please use [v3.1.3][v3.1.3].
|
- For Ruby < 2.4 and Rails < 4.1 compatibility, please use [v3.1.3][v3.1.3].
|
||||||
|
|
|
@ -32,7 +32,7 @@ def preprocess_index(contents)
|
||||||
map do |value|
|
map do |value|
|
||||||
value.
|
value.
|
||||||
split('_').
|
split('_').
|
||||||
map { |word| word[0].upcase + word[1..-1] }.
|
map { |word| word[0].upcase + word[1..] }.
|
||||||
join
|
join
|
||||||
end.
|
end.
|
||||||
join('::')
|
join('::')
|
||||||
|
|
|
@ -643,7 +643,7 @@ module Shoulda
|
||||||
if number_of_submatchers_for_failure_message > 1
|
if number_of_submatchers_for_failure_message > 1
|
||||||
"In checking that #{model.name} #{submatcher_description}, " +
|
"In checking that #{model.name} #{submatcher_description}, " +
|
||||||
failure_message[0].downcase +
|
failure_message[0].downcase +
|
||||||
failure_message[1..-1]
|
failure_message[1..]
|
||||||
else
|
else
|
||||||
failure_message
|
failure_message
|
||||||
end
|
end
|
||||||
|
|
|
@ -185,7 +185,7 @@ module Shoulda
|
||||||
leftover = ''
|
leftover = ''
|
||||||
else
|
else
|
||||||
fitted_line = line[0..index].rstrip
|
fitted_line = line[0..index].rstrip
|
||||||
leftover = line[index + 1..-1]
|
leftover = line[index + 1..]
|
||||||
end
|
end
|
||||||
|
|
||||||
{ fitted_line: fitted_line, leftover: leftover }
|
{ fitted_line: fitted_line, leftover: leftover }
|
||||||
|
|
|
@ -36,6 +36,6 @@ Gem::Specification.new do |s|
|
||||||
'shoulda-matchers.gemspec']
|
'shoulda-matchers.gemspec']
|
||||||
s.require_paths = ['lib']
|
s.require_paths = ['lib']
|
||||||
|
|
||||||
s.required_ruby_version = '>= 2.5.0'
|
s.required_ruby_version = '>= 2.6.0'
|
||||||
s.add_dependency('activesupport', '>= 5.0.0')
|
s.add_dependency('activesupport', '>= 5.0.0')
|
||||||
end
|
end
|
||||||
|
|
|
@ -95,7 +95,7 @@ module Tests
|
||||||
new_lines << "(...#{lines.size - 10} more lines...)"
|
new_lines << "(...#{lines.size - 10} more lines...)"
|
||||||
end
|
end
|
||||||
|
|
||||||
new_lines << lines[-5..-1]
|
new_lines << lines[-5..]
|
||||||
new_lines.join("\n")
|
new_lines.join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ module UnitTests
|
||||||
lines << Shoulda::Matchers::Util.indent(expected, 2)
|
lines << Shoulda::Matchers::Util.indent(expected, 2)
|
||||||
|
|
||||||
if @actual
|
if @actual
|
||||||
diff = differ.diff(@actual, expected)[1..-1]
|
diff = differ.diff(@actual, expected)[1..]
|
||||||
|
|
||||||
lines << 'Actually failed with:'
|
lines << 'Actually failed with:'
|
||||||
lines << Shoulda::Matchers::Util.indent(@actual, 2)
|
lines << Shoulda::Matchers::Util.indent(@actual, 2)
|
||||||
|
|
|
@ -205,7 +205,7 @@ Diff:
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff(expected, actual)
|
def diff(expected, actual)
|
||||||
differ.diff(expected, actual)[1..-1]
|
differ.diff(expected, actual)[1..]
|
||||||
end
|
end
|
||||||
|
|
||||||
def differ
|
def differ
|
||||||
|
|
|
@ -454,7 +454,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
||||||
|
|
||||||
it 'matches given a subset of the valid values' do
|
it 'matches given a subset of the valid values' do
|
||||||
builder = build_object_allowing(possible_values)
|
builder = build_object_allowing(possible_values)
|
||||||
expect_to_match_on_values(builder, possible_values[1..-1])
|
expect_to_match_on_values(builder, possible_values[1..])
|
||||||
end
|
end
|
||||||
|
|
||||||
if zero
|
if zero
|
||||||
|
|
Loading…
Reference in New Issue