From 3fee839fd02fe061fbd840ba970ee7c826636c02 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 22 Aug 2016 14:51:27 -0700 Subject: Require Ruby 2.1+ Just removes some 1.9 logic from testing. Signed-off-by: Tim Smith --- .travis.yml | 7 +++---- mixlib-shellout.gemspec | 2 +- spec/mixlib/shellout_spec.rb | 6 +----- spec/support/platform_helpers.rb | 9 --------- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 532f415..ea98a8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,9 @@ cache: bundler sudo: false rvm: - - 2.0 - - 2.1 - - 2.2 - - 2.3.0 + - 2.1.9 + - 2.2.5 + - 2.3.1 before_install: - gem update bundler diff --git a/mixlib-shellout.gemspec b/mixlib-shellout.gemspec index 37b7cf2..4aa568f 100644 --- a/mixlib-shellout.gemspec +++ b/mixlib-shellout.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.email = "info@chef.io" s.homepage = "https://www.chef.io/" - s.required_ruby_version = ">= 1.9.3" + s.required_ruby_version = ">= 2.1" s.add_development_dependency "rspec", "~> 3.0" diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 7e93054..38915f3 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -17,10 +17,7 @@ describe Mixlib::ShellOut do let(:ruby_code) { raise 'define let(:ruby_code)' } let(:options) { nil } - # On some testing environments, we have gems that creates a deprecation notice sent - # out on STDERR. To fix that, we disable gems on Ruby 1.9.2 - let(:ruby_eval) { lambda { |code| "ruby #{disable_gems} -e '#{code}'" } } - let(:disable_gems) { ( ruby_19? ? '--disable-gems' : '') } + let(:ruby_eval) { lambda { |code| "ruby -e '#{code}'" } } context 'when instantiating' do subject { shell_cmd } @@ -1144,7 +1141,6 @@ describe Mixlib::ShellOut do context 'on unix', :unix_only do def ruby_wo_shell(code) parts = %w[ruby] - parts << "--disable-gems" if ruby_19? parts << "-e" parts << code end diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index c730b4d..bbf7d15 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -1,12 +1,3 @@ - -def ruby_19? - !!(RUBY_VERSION =~ /^1.9/) -end - -def ruby_18? - !!(RUBY_VERSION =~ /^1.8/) -end - def windows? !!(RUBY_PLATFORM =~ /mswin|mingw|windows/) end -- cgit v1.2.1