Skip to content

Commit

Permalink
Update CI for newer rubies
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Apr 28, 2020
1 parent e2cd14f commit 2398f38
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*

Expand Down
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion deprecation_toolkit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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)/})
Expand Down
11 changes: 0 additions & 11 deletions gemfiles/activesupport_5.0.gemfile

This file was deleted.

11 changes: 0 additions & 11 deletions gemfiles/activesupport_5.1.gemfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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"
Expand Down
36 changes: 16 additions & 20 deletions test/minitest/deprecation_toolkit_plugin_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 2398f38

Please sign in to comment.