diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-01 12:49:40 +0300 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-09 12:44:10 +0900 |
commit | 8f37629519ad330032a38ac0e871b2912ed38a1b (patch) | |
tree | bb0529b77583d47993d8b0d608d68896aa3a5298 /spec/bundler/support | |
parent | 66508992483ae5d77b56a98427c50c772341c0ac (diff) | |
download | ruby-8f37629519ad330032a38ac0e871b2912ed38a1b.tar.gz |
Merge bundler master from upstream.
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
Diffstat (limited to 'spec/bundler/support')
-rw-r--r-- | spec/bundler/support/code_climate.rb | 26 | ||||
-rw-r--r-- | spec/bundler/support/command_execution.rb | 8 | ||||
-rw-r--r-- | spec/bundler/support/hax.rb | 2 | ||||
-rw-r--r-- | spec/bundler/support/helpers.rb | 4 | ||||
-rw-r--r-- | spec/bundler/support/matchers.rb | 8 | ||||
-rw-r--r-- | spec/bundler/support/platforms.rb | 2 |
6 files changed, 9 insertions, 41 deletions
diff --git a/spec/bundler/support/code_climate.rb b/spec/bundler/support/code_climate.rb deleted file mode 100644 index a15442cabe..0000000000 --- a/spec/bundler/support/code_climate.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -module Spec - module CodeClimate - def self.setup - require "codeclimate-test-reporter" - ::CodeClimate::TestReporter.start - configure_exclusions - rescue LoadError - # it's fine if CodeClimate isn't set up - nil - end - - def self.configure_exclusions - SimpleCov.start do - add_filter "/bin/" - add_filter "/lib/bundler/man/" - add_filter "/lib/bundler/vendor/" - add_filter "/man/" - add_filter "/pkg/" - add_filter "/spec/" - add_filter "/tmp/" - end - end - end -end diff --git a/spec/bundler/support/command_execution.rb b/spec/bundler/support/command_execution.rb index 556285ac52..cec531d6c3 100644 --- a/spec/bundler/support/command_execution.rb +++ b/spec/bundler/support/command_execution.rb @@ -27,14 +27,6 @@ module Spec @stdboth ||= [stderr, stdout].join("\n").strip end - def bundler_err - if Bundler::VERSION.start_with?("1.") - stdout - else - stderr - end - end - def to_s_verbose [ to_s, diff --git a/spec/bundler/support/hax.rb b/spec/bundler/support/hax.rb index b14e4a5943..202e8dcc32 100644 --- a/spec/bundler/support/hax.rb +++ b/spec/bundler/support/hax.rb @@ -21,6 +21,8 @@ module Gem end if ENV["BUNDLER_SPEC_VERSION"] + require "bundler/version" + module Bundler remove_const(:VERSION) if const_defined?(:VERSION) VERSION = ENV["BUNDLER_SPEC_VERSION"].dup diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index 09e7419a98..478fe60822 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -45,13 +45,13 @@ module Spec end def err - Bundler.feature_flag.error_on_stderr? ? last_command.stderr : last_command.stdout + last_command.stderr end MAJOR_DEPRECATION = /^\[DEPRECATED\]\s*/.freeze def err_without_deprecations - last_command.stderr.gsub(/#{MAJOR_DEPRECATION}.+[\n]?/, "") + err.gsub(/#{MAJOR_DEPRECATION}.+[\n]?/, "") end def deprecations diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb index f9efe32a38..5d1a6a7919 100644 --- a/spec/bundler/support/matchers.rb +++ b/spec/bundler/support/matchers.rb @@ -133,7 +133,7 @@ module Spec rescue StandardError => e next "#{name} is not installed:\n#{indent(e)}" end - actual_version, actual_platform = last_command.stdout.strip.split(/\s+/, 2) + actual_version, actual_platform = out.strip.split(/\s+/, 2) unless Gem::Version.new(actual_version) == Gem::Version.new(version) next "#{name} was expected to be at version #{version} but was #{actual_version}" end @@ -147,7 +147,7 @@ module Spec rescue StandardError next "#{name} does not have a source defined:\n#{indent(e)}" end - unless last_command.stdout.strip == source + unless out.strip == source next "Expected #{name} (#{version}) to be installed from `#{source}`, was actually from `#{out}`" end end.compact @@ -172,9 +172,9 @@ module Spec rescue StandardError => e next "checking for #{name} failed:\n#{e}" end - next if last_command.stdout == "WIN" + next if out == "WIN" next "expected #{name} to not be installed, but it was" if version.nil? - if Gem::Version.new(last_command.stdout) == Gem::Version.new(version) + if Gem::Version.new(out) == Gem::Version.new(version) next "expected #{name} (#{version}) not to be installed, but it was" end end.compact diff --git a/spec/bundler/support/platforms.rb b/spec/bundler/support/platforms.rb index 0a9e4a8cb6..caac7734bf 100644 --- a/spec/bundler/support/platforms.rb +++ b/spec/bundler/support/platforms.rb @@ -105,7 +105,7 @@ module Spec end def local_platforms - if Bundler::VERSION.split(".").first.to_i > 2 + if Bundler.feature_flag.specific_platform? [local, specific_local_platform] else [local] |