Skip to content

Commit

Permalink
chore: fix bundler versioning tests
Browse files Browse the repository at this point in the history
  • Loading branch information
g-arjones committed Jul 10, 2024
1 parent cb07e10 commit b695ebe
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/ops/test_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,35 +228,35 @@ module Ops
it "picks a specific bundler version as passed in the seed config" do
seed_config_path = File.join(make_tmpdir, "config.yml")
File.open(seed_config_path, "w") do |io|
YAML.dump({ "bundler_version" => "2.0.1" }, io)
YAML.dump({ "bundler_version" => "2.3.26" }, io)
end

dir, = invoke_test_script(
"install.sh", "--seed-config", seed_config_path
)
assert_match(/2.0.1/, `#{dir}/.autoproj/bin/bundle --version`.strip)
assert_match(/2.3.26/, `#{dir}/.autoproj/bin/bundle --version`.strip)
end

it "picks a specific bundler version as passed on the command line" do
dir, = invoke_test_script("install.sh", "--bundler-version", "2.0.1")
assert_match(/2.0.1/, `#{dir}/.autoproj/bin/bundle --version`.strip)
dir, = invoke_test_script("install.sh", "--bundler-version", "2.3.26")
assert_match(/2.3.26/, `#{dir}/.autoproj/bin/bundle --version`.strip)
end

it "pins the install to the selected bundler version" do
dir, = invoke_test_script("install.sh", "--bundler-version", "2.0.1")
dir, = invoke_test_script("install.sh", "--bundler-version", "2.3.26")
`#{dir}/.autoproj/bin/autoproj update`
assert_match(/2.0.1/, `#{dir}/.autoproj/bin/bundle --version`.strip)
assert_match(/2.3.26/, `#{dir}/.autoproj/bin/bundle --version`.strip)
end

it "can pin a bundler version on an existing bootstrap" do
dir, = invoke_test_script("install.sh")
refute_match(/2.0.1/, `#{dir}/.autoproj/bin/bundle --version`.strip)
dir, = invoke_test_script("install.sh", "--bundler-version", "2.0.1")
assert_match(/2.0.1/, `#{dir}/.autoproj/bin/bundle --version`.strip)
refute_match(/2.3.26/, `#{dir}/.autoproj/bin/bundle --version`.strip)
dir, = invoke_test_script("install.sh", "--bundler-version", "2.3.26")
assert_match(/2.3.26/, `#{dir}/.autoproj/bin/bundle --version`.strip)
end

it "can unpin a bundler version after the bootstrap" do
dir, = invoke_test_script("install.sh", "--bundler-version", "2.0.1")
dir, = invoke_test_script("install.sh", "--bundler-version", "2.3.26")

config_yml = File.join(dir, ".autoproj", "config.yml")
config = YAML.safe_load(File.read(config_yml))
Expand All @@ -265,7 +265,7 @@ module Ops
YAML.dump(config, io)
end
`#{dir}/.autoproj/bin/autoproj update`
refute_match(/2.0.1/, `#{dir}/.autoproj/bin/bundle --version`.strip)
refute_match(/2.3.26/, `#{dir}/.autoproj/bin/bundle --version`.strip)
end
end
end
Expand Down

0 comments on commit b695ebe

Please sign in to comment.