Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bundler/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ def self.ruby=(ruby)
ENV["XDG_CACHE_HOME"] = nil
ENV["GEMRC"] = nil

# Prevent tests from modifying the user's global git config.
# GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM are available since Git 2.32.
git_version = `git --version`[/(\d+\.\d+\.\d+)/, 1]
if Gem::Version.new(git_version) >= Gem::Version.new("2.32")
Comment on lines +133 to +134
ENV["GIT_CONFIG_GLOBAL"] = File.join(ENV["HOME"], ".gitconfig")
ENV["GIT_CONFIG_NOSYSTEM"] = "1"
end

# Don't wrap output in tests
ENV["THOR_COLUMNS"] = "10000"

Expand Down
3 changes: 3 additions & 0 deletions bundler/spec/support/filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ def inspect
end
end

git_version = Gem::Version.new(`git --version`[/(\d+\.\d+\.\d+)/, 1])

Comment on lines +21 to +22
RSpec.configure do |config|
config.filter_run_excluding realworld: true

config.filter_run_excluding rubygems: RequirementChecker.against(Gem.rubygems_version)
config.filter_run_excluding git: RequirementChecker.against(git_version)
config.filter_run_excluding ruby_repo: !ENV["GEM_COMMAND"].nil?
config.filter_run_excluding no_color_tty: Gem.win_platform? || !ENV["GITHUB_ACTION"].nil?
config.filter_run_excluding permissions: Gem.win_platform?
Expand Down
Loading