diff --git a/.circleci/config.yml b/.circleci/config.yml index df78d9f8..363333f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,9 +38,6 @@ workflows: build: jobs: - documentation-checks - - rake_default: - name: Ruby 2.4 - image: circleci/ruby:2.4 - rake_default: name: Ruby 2.5 image: circleci/ruby:2.5 diff --git a/.rubocop.yml b/.rubocop.yml index 7aba8734..0c667888 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,7 +9,7 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 2.4 + TargetRubyVersion: 2.5 SuggestExtensions: false InternalAffairs/NodeMatcherDirective: diff --git a/CHANGELOG.md b/CHANGELOG.md index f3af0a6b..5133cdce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master (unreleased) +### Changes + +* [#129](https://github.com/rubocop/rubocop-minitest/pull/129): Drop Ruby 2.4 support. ([@koic][]) + ## 0.11.1 (2021-03-31) ### Changes diff --git a/rubocop-minitest.gemspec b/rubocop-minitest.gemspec index 908ec6c6..7fa5062a 100644 --- a/rubocop-minitest.gemspec +++ b/rubocop-minitest.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |spec| DESCRIPTION spec.license = 'MIT' - spec.required_ruby_version = '>= 2.4.0' + spec.required_ruby_version = '>= 2.5.0' spec.metadata = { 'homepage_uri' => 'https://docs.rubocop.org/rubocop-minitest/', 'changelog_uri' => 'https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md', diff --git a/tasks/cops_documentation.rake b/tasks/cops_documentation.rake index 86111441..99fb2a7c 100644 --- a/tasks/cops_documentation.rake +++ b/tasks/cops_documentation.rake @@ -46,17 +46,15 @@ task documentation_syntax_check: :yard_for_generate_documentation do end examples.to_a.each do |example| - begin - buffer = Parser::Source::Buffer.new('', 1) - buffer.source = example.text - parser = Parser::Ruby25.new(RuboCop::AST::Builder.new) - parser.diagnostics.all_errors_are_fatal = true - parser.parse(buffer) - rescue Parser::SyntaxError => e - path = example.object.file - puts "#{path}: Syntax Error in an example. #{e}" - ok = false - end + buffer = Parser::Source::Buffer.new('', 1) + buffer.source = example.text + parser = Parser::Ruby25.new(RuboCop::AST::Builder.new) + parser.diagnostics.all_errors_are_fatal = true + parser.parse(buffer) + rescue Parser::SyntaxError => e + path = example.object.file + puts "#{path}: Syntax Error in an example. #{e}" + ok = false end end abort unless ok diff --git a/test/assertion_helper.rb b/test/assertion_helper.rb index ab6e8fc1..23f842a2 100644 --- a/test/assertion_helper.rb +++ b/test/assertion_helper.rb @@ -8,7 +8,7 @@ module AssertionHelper private def setup - cop_name = self.class.to_s.sub(/Test\z/, '') + cop_name = self.class.to_s.delete_suffix('Test') @cop = RuboCop::Cop::Minitest.const_get(cop_name).new end @@ -88,6 +88,6 @@ def parse_source!(source, file = nil) end def ruby_version - 2.4 + 2.5 end end