diff options
Diffstat (limited to 'spec/commands')
-rw-r--r-- | spec/commands/config_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 18 | ||||
-rw-r--r-- | spec/commands/info_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/open_spec.rb | 10 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 2 |
6 files changed, 23 insertions, 13 deletions
diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index c0ef3bb70c..ef580463e5 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -389,7 +389,7 @@ E end describe "subcommands" do - it "list", :ruby_repo do + it "list" do bundle! "config list" expect(out).to eq "Settings are listed in order of priority. The top value will be used.\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\"" diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index ec75b9eb0d..a36b303060 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -33,7 +33,7 @@ RSpec.describe "bundle exec" do expect(out).to eq("1.0.0") end - it "works when running from a random directory", :ruby_repo do + it "works when running from a random directory" do install_gemfile <<-G gem "rack" G @@ -56,14 +56,14 @@ RSpec.describe "bundle exec" do end it "respects custom process title when loading through ruby", :github_action_linux 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-16") - puts `ps -eo args | grep [1]-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16` + 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") + puts `ps -ocommand= -p#{$$}` RUBY create_file "Gemfile" create_file "a.rb", script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility bundle "exec ruby a.rb" - expect(out).to eq("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16") + expect(out).to eq("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15") end it "accepts --verbose" do @@ -192,7 +192,7 @@ RSpec.describe "bundle exec" do it "uses version specified" do bundle! "exec irb --version" - expect(out).to include(specified_irb_version) + expect(out).to eq(specified_irb_version) expect(err).to be_empty end end @@ -222,7 +222,7 @@ RSpec.describe "bundle exec" do end it "uses resolved version" do - expect(out).to include(indirect_irb_version) + expect(out).to eq(indirect_irb_version) expect(err).to be_empty end end @@ -336,7 +336,7 @@ RSpec.describe "bundle exec" do expect(err).to include("bundler: exec needs a command to run") end - it "raises a helpful error when exec'ing to something outside of the bundle", :ruby_repo do + it "raises a helpful error when exec'ing to something outside of the bundle" do bundle! "config set clean false" # want to keep the rackup binstub install_gemfile! <<-G source "#{file_uri_for(gem_repo1)}" @@ -688,7 +688,7 @@ RSpec.describe "bundle exec" do it_behaves_like "it runs" end - context "when the file uses the current ruby shebang", :ruby_repo do + context "when the file uses the current ruby shebang" do let(:shebang) { "#!#{Gem.ruby}" } it_behaves_like "it runs" end diff --git a/spec/commands/info_spec.rb b/spec/commands/info_spec.rb index aa6b237d50..4572823498 100644 --- a/spec/commands/info_spec.rb +++ b/spec/commands/info_spec.rb @@ -116,7 +116,7 @@ RSpec.describe "bundle info" do end end - context "with a valid regexp for gem name", :ruby_repo do + context "with a valid regexp for gem name" do it "presents alternatives" do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index beb21f9c2b..32c1868cd2 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -210,7 +210,7 @@ RSpec.describe "bundle gem" do end end - it "generates a valid gemspec", :ruby_repo do + it "generates a valid gemspec" do in_app_root bundle! "gem newgem --bin" diff --git a/spec/commands/open_spec.rb b/spec/commands/open_spec.rb index 649ae06fda..8fae4af5b4 100644 --- a/spec/commands/open_spec.rb +++ b/spec/commands/open_spec.rb @@ -93,7 +93,17 @@ RSpec.describe "bundle open" do end context "when opening a default gem" do + let(:default_gems) do + ruby!(<<-RUBY).split("\n") + if Gem::Specification.is_a?(Enumerable) + puts Gem::Specification.select(&:default_gem?).map(&:name) + end + RUBY + end + before do + skip "No default gems available on this test run" if default_gems.empty? + install_gemfile <<-G gem "json" G diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index ce45a961f0..61b8f73e7f 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -166,7 +166,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end context "with a valid regexp for gem name" do - it "presents alternatives", :ruby_repo do + it "presents alternatives" do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" |