summaryrefslogtreecommitdiff
path: root/spec/bundler/bundler
diff options
context:
space:
mode:
authorEric Mueller <nevinera@gmail.com>2023-12-01 23:23:18 -0500
committergit <svn-admin@ruby-lang.org>2023-12-06 20:05:25 +0000
commit9336bbb0b268cb655e6c07ad2a83b9a28cb98911 (patch)
treefa37aafea011a3fef177c8dd8c91c62709d104ce /spec/bundler/bundler
parent6fd3b358ff1e1745036286be7007cd0d6ebdcdd7 (diff)
[rubygems/rubygems] Bundler::Fetcher uses Bundler::CIDetector
Additionally, the result is memoized, as it's used twice in a row. This change does result in a net behavioral diff, as the list of ENVs being checked has been updated (now includes buildkite, taskcluster, cirrus, dsari, and drops buildbox and snap) https://github.com/rubygems/rubygems/commit/3fb445a5a1
Diffstat (limited to 'spec/bundler/bundler')
-rw-r--r--spec/bundler/bundler/fetcher_spec.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/bundler/bundler/fetcher_spec.rb b/spec/bundler/bundler/fetcher_spec.rb
index 92790dc7d6..f764c44fae 100644
--- a/spec/bundler/bundler/fetcher_spec.rb
+++ b/spec/bundler/bundler/fetcher_spec.rb
@@ -143,18 +143,20 @@ RSpec.describe Bundler::Fetcher do
describe "include CI information" do
it "from one CI" do
- with_env_vars("JENKINS_URL" => "foo") do
+ with_env_vars("CI" => nil, "JENKINS_URL" => "foo") do
ci_part = fetcher.user_agent.split(" ").find {|x| x.start_with?("ci/") }
- expect(ci_part).to match("jenkins")
+ cis = ci_part.split("/").last.split(",")
+ expect(cis).to include("jenkins")
+ expect(cis).not_to include("ci")
end
end
it "from many CI" do
- with_env_vars("TRAVIS" => "foo", "GITLAB_CI" => "gitlab", "CI_NAME" => "my_ci") do
+ with_env_vars("CI" => "true", "SEMAPHORE" => nil, "TRAVIS" => "foo", "GITLAB_CI" => "gitlab", "CI_NAME" => "MY_ci") do
ci_part = fetcher.user_agent.split(" ").find {|x| x.start_with?("ci/") }
- expect(ci_part).to match("travis")
- expect(ci_part).to match("gitlab")
- expect(ci_part).to match("my_ci")
+ cis = ci_part.split("/").last.split(",")
+ expect(cis).to include("ci", "gitlab", "my_ci", "travis")
+ expect(cis).not_to include("semaphore")
end
end
end