Skip to content

Commit e0858bd

Browse files
committed
🧪 Isolate auth sanitizer load path spec from Bundler
1 parent 7032b58 commit e0858bd

3 files changed

Lines changed: 25 additions & 11 deletions

File tree

.rubocop_gradual.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"spec/oauth2/auth_sanitizer_spec.rb:899913194": [
2+
"spec/oauth2/auth_sanitizer_spec.rb:2223470268": [
33
[19, 14, 2, "Lint/Syntax: unexpected token tLSHFT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5859461],
4-
[54, 35, 2, "Lint/Syntax: unexpected token tLSHFT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5859461],
5-
[55, 38, 2, "Lint/Syntax: unexpected token tIDENTIFIER\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5861278],
6-
[55, 66, 4, "Lint/Syntax: unexpected token tIDENTIFIER\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 2087898353],
7-
[57, 13, 1, "Lint/Syntax: unexpected token tCOLON\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 177567]
4+
[65, 35, 2, "Lint/Syntax: unexpected token tLSHFT\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5859461],
5+
[66, 38, 2, "Lint/Syntax: unexpected token tIDENTIFIER\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 5861278],
6+
[66, 66, 4, "Lint/Syntax: unexpected token tIDENTIFIER\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 2087898353],
7+
[68, 13, 1, "Lint/Syntax: unexpected token tCOLON\n(Using Ruby 2.2 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)", 177567]
88
]
99
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Please file a bug if you notice a violation of semantic versioning.
2828

2929
### Fixed
3030

31+
- Fixed the isolated `auth-sanitizer` load-path regression spec so subprocess
32+
RubyGems startup cannot inherit Bundler/Appraisal activation from CI.
33+
3134
### Security
3235

3336
## [2.0.24] - 2026-06-18

spec/oauth2/auth_sanitizer_spec.rb

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,25 @@ def find_by_name(name, *requirements)
3434
require "oauth2/auth_sanitizer"
3535
abort("OAuth2::AUTH_SANITIZER was not loaded") unless OAuth2.const_defined?(:AUTH_SANITIZER, false)
3636
RUBY
37+
ruby_env = if defined?(Bundler)
38+
Bundler.with_unbundled_env { ENV.to_h }
39+
else
40+
ENV.to_h
41+
end
42+
%w[
43+
BUNDLE_BIN_PATH
44+
BUNDLE_GEMFILE
45+
BUNDLE_PATH
46+
BUNDLE_WITH
47+
BUNDLE_WITHOUT
48+
BUNDLER_VERSION
49+
RUBYGEMS_GEMDEPS
50+
RUBYLIB
51+
RUBYOPT
52+
].each { |key| ruby_env[key] = nil }
3753

3854
stdout, stderr, status = Open3.capture3(
39-
{
40-
"BUNDLE_GEMFILE" => nil,
41-
"BUNDLER_VERSION" => nil,
42-
"RUBYLIB" => nil,
43-
"RUBYOPT" => nil,
44-
},
55+
ruby_env,
4556
RbConfig.ruby,
4657
"-I",
4758
oauth2_lib,

0 commit comments

Comments
 (0)