diff --git a/.rubocop.yml b/.rubocop.yml index b5d5915..13a1245 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_from: - https://shopify.github.io/ruby-style-guide/rubocop.yml AllCops: - TargetRubyVersion: 2.4 + TargetRubyVersion: 2.5 Exclude: - gemfiles/vendor/**/* diff --git a/.travis.yml b/.travis.yml index c5bf646..86b575e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,12 @@ language: ruby before_install: - gem update bundler rvm: - - 2.3 - - 2.4 - 2.5 + - 2.6 + - 2.7 gemfile: - - gemfiles/activesupport_4.2.gemfile - - gemfiles/activesupport_5.0.gemfile - - gemfiles/activesupport_5.1.gemfile - gemfiles/activesupport_5.2.gemfile + - gemfiles/activesupport_6.0.gemfile script: - bundle exec rubocop --config .rubocop.yml - bundle exec rake test diff --git a/Gemfile.lock b/Gemfile.lock index ec982c4..3ed09b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,7 +19,7 @@ GEM i18n (1.8.2) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) - minitest (5.11.3) + minitest (5.14.0) parallel (1.19.1) parser (2.7.1.1) ast (~> 2.4.0) diff --git a/deprecation_toolkit.gemspec b/deprecation_toolkit.gemspec index beeeefa..3e4a739 100644 --- a/deprecation_toolkit.gemspec +++ b/deprecation_toolkit.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |spec| spec.metadata['allowed_push_host'] = "https://rubygems.org" - spec.required_ruby_version = '>= 2.3' + spec.required_ruby_version = '>= 2.5' spec.files = %x(git ls-files -z).split("\x0").reject do |f| f.match(%r{^(test)/}) diff --git a/gemfiles/activesupport_5.0.gemfile b/gemfiles/activesupport_5.0.gemfile deleted file mode 100644 index 07033cc..0000000 --- a/gemfiles/activesupport_5.0.gemfile +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true -source "https://rubygems.org" - -gem "activesupport", "~> 5.0" - -group :deployment do - gem "rake" - gem "rubocop" -end - -gemspec path: "../" diff --git a/gemfiles/activesupport_5.1.gemfile b/gemfiles/activesupport_5.1.gemfile deleted file mode 100644 index ca9ae6e..0000000 --- a/gemfiles/activesupport_5.1.gemfile +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true -source "https://rubygems.org" - -gem "activesupport", "~> 5.1" - -group :deployment do - gem "rake" - gem "rubocop" -end - -gemspec path: "../" diff --git a/gemfiles/activesupport_4.2.gemfile b/gemfiles/activesupport_6.0.gemfile similarity index 82% rename from gemfiles/activesupport_4.2.gemfile rename to gemfiles/activesupport_6.0.gemfile index 77cfdec..097dc62 100644 --- a/gemfiles/activesupport_4.2.gemfile +++ b/gemfiles/activesupport_6.0.gemfile @@ -1,7 +1,7 @@ # frozen_string_literal: true source "https://rubygems.org" -gem "activesupport", "~> 4.2" +gem "activesupport", "~> 6.0" group :deployment do gem "rake" diff --git a/test/minitest/deprecation_toolkit_plugin_test.rb b/test/minitest/deprecation_toolkit_plugin_test.rb index 413420c..8fbf687 100644 --- a/test/minitest/deprecation_toolkit_plugin_test.rb +++ b/test/minitest/deprecation_toolkit_plugin_test.rb @@ -16,14 +16,12 @@ class DeprecationToolkitPluginTest < ActiveSupport::TestCase end test ".plugin_deprecation_toolkit_init set the behavior to `Record` when `record_deprecations` options is true" do - begin - previous_behavior = DeprecationToolkit::Configuration.behavior - Minitest.plugin_deprecation_toolkit_init(record_deprecations: true) + previous_behavior = DeprecationToolkit::Configuration.behavior + Minitest.plugin_deprecation_toolkit_init(record_deprecations: true) - assert_equal(DeprecationToolkit::Behaviors::Record, DeprecationToolkit::Configuration.behavior) - ensure - DeprecationToolkit::Configuration.behavior = previous_behavior - end + assert_equal(DeprecationToolkit::Behaviors::Record, DeprecationToolkit::Configuration.behavior) + ensure + DeprecationToolkit::Configuration.behavior = previous_behavior end test ".plugin_deprecation_toolkit_init add `notify` behavior to the deprecations behavior list" do @@ -62,19 +60,17 @@ class DeprecationToolkitPluginTest < ActiveSupport::TestCase end test ".plugin_deprecation_toolkit_init doesn't init plugin when outside bundler context" do - begin - notify_behavior = ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:notify] - old_bundle_gemfile = ENV['BUNDLE_GEMFILE'] - ENV.delete('BUNDLE_GEMFILE') - - ActiveSupport::Deprecation.behavior.delete(notify_behavior) - Minitest.plugin_deprecation_toolkit_init({}) - - refute_includes(ActiveSupport::Deprecation.behavior, notify_behavior) - ensure - ENV['BUNDLE_GEMFILE'] = old_bundle_gemfile - ActiveSupport::Deprecation.behavior << notify_behavior - end + notify_behavior = ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:notify] + old_bundle_gemfile = ENV['BUNDLE_GEMFILE'] + ENV.delete('BUNDLE_GEMFILE') + + ActiveSupport::Deprecation.behavior.delete(notify_behavior) + Minitest.plugin_deprecation_toolkit_init({}) + + refute_includes(ActiveSupport::Deprecation.behavior, notify_behavior) + ensure + ENV['BUNDLE_GEMFILE'] = old_bundle_gemfile + ActiveSupport::Deprecation.behavior << notify_behavior end end end