summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/binstubs_spec.rb2
-rw-r--r--spec/commands/clean_spec.rb2
-rw-r--r--spec/commands/exec_spec.rb8
-rw-r--r--spec/commands/install_spec.rb2
-rw-r--r--spec/commands/outdated_spec.rb2
-rw-r--r--spec/commands/version_spec.rb12
6 files changed, 21 insertions, 7 deletions
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb
index df10bd3498..7c04e8ddbd 100644
--- a/spec/commands/binstubs_spec.rb
+++ b/spec/commands/binstubs_spec.rb
@@ -458,7 +458,7 @@ RSpec.describe "bundle binstubs <gem>" do
G
bundle "config set auto_install 1"
- bundle "binstubs rack", :env => { "BUNDLE_INSTALL" => 1 }
+ bundle "binstubs rack", :env => { "BUNDLE_INSTALL" => "1" }
expect(out).not_to include("Installing rack 1.0.0")
end
end
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb
index 7f9f84c104..5cc97de912 100644
--- a/spec/commands/clean_spec.rb
+++ b/spec/commands/clean_spec.rb
@@ -782,7 +782,7 @@ RSpec.describe "bundle clean" do
expect(vendored_gems("bundler/gems/very_simple_git_binary-1.0-#{revision[0..11]}")).to exist
bundle! :clean
- expect(out).to eq("")
+ expect(out).to be_empty
expect(vendored_gems("bundler/gems/extensions")).to exist
expect(vendored_gems("bundler/gems/very_simple_git_binary-1.0-#{revision[0..11]}")).to exist
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index 7ae504d360..c1d6e4c25a 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -55,6 +55,12 @@ RSpec.describe "bundle exec" do
expect(out).to eq("hi")
end
+ it "works when exec'ing to rubygems" do
+ install_gemfile 'gem "rack"'
+ bundle "exec #{gem_cmd} --version"
+ expect(out).to eq(Gem::VERSION)
+ end
+
it "respects custom process title when loading through ruby" 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")
@@ -98,7 +104,7 @@ RSpec.describe "bundle exec" do
install_gemfile ""
sys_exec "#{Gem.ruby} #{command.path}"
- expect(out).to eq("")
+ expect(out).to be_empty
expect(err).to be_empty
end
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index 8e161a4aae..b57d81b10a 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -45,7 +45,7 @@ RSpec.describe "bundle install with gem sources" do
gem "rack"
G
- bundle! :install, :env => { "BUNDLE_PATH__SYSTEM" => true } # can't use install_gemfile since it sets retry
+ bundle! :install, :env => { "BUNDLE_PATH__SYSTEM" => "true" } # can't use install_gemfile since it sets retry
expect(bundled_app(".bundle")).not_to exist
end
diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb
index ab54925756..6e82d34b05 100644
--- a/spec/commands/outdated_spec.rb
+++ b/spec/commands/outdated_spec.rb
@@ -228,7 +228,7 @@ RSpec.describe "bundle outdated" do
context "and no gems are outdated" do
it "has empty output" do
subject
- expect(out).to eq("")
+ expect(out).to be_empty
end
end
end
diff --git a/spec/commands/version_spec.rb b/spec/commands/version_spec.rb
index 66c7930397..8eecd9c53e 100644
--- a/spec/commands/version_spec.rb
+++ b/spec/commands/version_spec.rb
@@ -1,6 +1,14 @@
# frozen_string_literal: true
+require_relative "../support/path"
+
RSpec.describe "bundle version" do
+ if Spec::Path.ruby_core?
+ COMMIT_HASH = /unknown|[a-fA-F0-9]{7,}/.freeze
+ else
+ COMMIT_HASH = /[a-fA-F0-9]{7,}/.freeze
+ end
+
context "with -v" do
it "outputs the version", :bundler => "< 3" do
bundle! "-v"
@@ -28,12 +36,12 @@ RSpec.describe "bundle version" do
context "with version" do
it "outputs the version with build metadata", :bundler => "< 3" do
bundle! "version"
- expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
+ expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/)
end
it "outputs the version with build metadata", :bundler => "3" do
bundle! "version"
- expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
+ expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/)
end
end
end