diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 62a292fcee2..af1836009f4 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -2,7 +2,6 @@ require "pathname" require "rbconfig" -require "rubygems" require_relative "version" require_relative "constants" diff --git a/spec/bundler/source_spec.rb b/spec/bundler/source_spec.rb index 9ae6b3e3eb6..46d86937dab 100644 --- a/spec/bundler/source_spec.rb +++ b/spec/bundler/source_spec.rb @@ -56,7 +56,7 @@ class ExampleSource < Bundler::Source context "with a different version" do let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "< 1.5") } - context "with color", :non_windows do + context "with color", :no_color_tty do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the spec name and version and locked spec version" do @@ -77,7 +77,7 @@ class ExampleSource < Bundler::Source let(:spec) { double(:spec, :name => "nokogiri", :version => "1.6.1", :platform => rb) } let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") } - context "with color", :non_windows do + context "with color", :no_color_tty do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in yellow" do @@ -98,7 +98,7 @@ class ExampleSource < Bundler::Source let(:spec) { double(:spec, :name => "nokogiri", :version => "1.7.1", :platform => rb) } let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") } - context "with color", :non_windows do + context "with color", :no_color_tty do before { Bundler.ui = Bundler::UI::Shell.new } it "should return a string with the locked spec version in green" do diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index 748cf6362fa..81b4d99064e 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -264,7 +264,7 @@ end context "when using --shebang" do - it "sets the specified shebang for the the binstub" do + it "sets the specified shebang for the binstub" do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 8ad5a3c125b..bb13b1b0862 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -55,7 +55,7 @@ expect(out).to eq("hi") end - it "respects custom process title when loading through ruby" do + it "respects custom process title when loading through ruby", :github_action_linux do script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility = <<~RUBY Process.setproctitle("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16") puts `ps -eo args | grep [1]-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16` @@ -299,7 +299,7 @@ G rubylib = ENV["RUBYLIB"] - rubylib = rubylib.to_s.split(File::PATH_SEPARATOR).unshift bundler_path + rubylib = rubylib.to_s.split(File::PATH_SEPARATOR).unshift bundler_path.to_s rubylib = rubylib.uniq.join(File::PATH_SEPARATOR) bundle "exec 'echo $RUBYLIB'" diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 94f4d82e981..7b05bf3ed0b 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -275,7 +275,8 @@ def create_temporary_dir(dir) end it "sets a minimum ruby version" do - bundler_gemspec = Bundler::GemHelper.new(File.expand_path("../..", __dir__)).gemspec + gemspec_path = ruby_core? ? "../../../lib/bundler" : "../.." + bundler_gemspec = Bundler::GemHelper.new(File.expand_path(gemspec_path, __dir__)).gemspec expect(bundler_gemspec.required_ruby_version).to eq(generated_gemspec.required_ruby_version) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fc9b8008879..14df93a3da7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -71,7 +71,8 @@ def self.ruby=(ruby) config.filter_run_excluding :git => RequirementChecker.against(git_version) config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0]) config.filter_run_excluding :ruby_repo => !(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]).nil? - config.filter_run_excluding :non_windows => Gem.win_platform? + config.filter_run_excluding :no_color_tty => Gem.win_platform? || !ENV["GITHUB_ACTION"].nil? + config.filter_run_excluding :github_action_linux => !ENV["GITHUB_ACTION"].nil? && (ENV["RUNNER_OS"] == "Linux") config.filter_run_when_matching :focus unless ENV["CI"] @@ -100,6 +101,7 @@ def self.ruby=(ruby) ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{Spec::Path.spec_dir}/support/hax.rb" ENV["BUNDLE_SPEC_RUN"] = "true" ENV["BUNDLE_USER_CONFIG"] = ENV["BUNDLE_USER_CACHE"] = ENV["BUNDLE_USER_PLUGIN"] = nil + ENV["GEMRC"] = nil # Don't wrap output in tests ENV["THOR_COLUMNS"] = "10000"