diff options
Diffstat (limited to 'spec/commands/show_spec.rb')
-rw-r--r-- | spec/commands/show_spec.rb | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 61b8f73e7f..5dd800e7c4 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -10,28 +10,28 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "creates a Gemfile.lock if one did not exist" do - FileUtils.rm("Gemfile.lock") + FileUtils.rm(bundled_app_lock) - bundle "show" + bundle! "show" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "creates a Gemfile.lock when invoked with a gem name" do - FileUtils.rm("Gemfile.lock") + FileUtils.rm(bundled_app_lock) - bundle "show rails" + bundle! "show rails" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "prints path if gem exists in bundle" do - bundle "show rails" + bundle! "show rails" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end it "prints path if gem exists in bundle (with --paths option)" do - bundle "show rails --paths" + bundle! "show rails --paths" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end @@ -45,7 +45,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints the path to the running bundler" do - bundle "show bundler" + bundle! "show bundler" expect(out).to eq(root.to_s) end @@ -55,7 +55,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints path of all gems in bundle sorted by name" do - bundle "show --paths" + bundle! "show --paths" expect(out).to include(default_bundle_path("gems", "rake-12.3.2").to_s) expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s) @@ -66,7 +66,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints summary of gems" do - bundle "show --verbose" + bundle! "show --verbose" expect(out).to include <<~MSG * actionmailer (2.3.2) @@ -77,7 +77,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "includes bundler in the summary of gems" do - bundle "show --verbose" + bundle! "show --verbose" expect(out).to include <<~MSG * bundler (#{Bundler::VERSION}) @@ -99,7 +99,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G expect(the_bundle).to include_gems "foo 1.0" - bundle :show + bundle! :show expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") end @@ -114,7 +114,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G expect(the_bundle).to include_gems "foo 1.0.omg" - bundle :show + bundle! :show expect(out).to include("foo (1.0 #{@git.ref_for("omg", 6)}") end @@ -124,7 +124,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}" G - bundle :show + bundle! :show expect(out).to include("foo (1.0 #{sha[0..6]})") end @@ -143,13 +143,12 @@ RSpec.describe "bundle show", :bundler => "< 3" do context "in a fresh gem in a blank git repo" do before :each do build_git "foo", :path => lib_path("foo") - in_app_root_custom lib_path("foo") - File.open("Gemfile", "w") {|f| f.puts "gemspec" } - sys_exec "rm -rf .git && git init" + File.open(lib_path("foo/Gemfile"), "w") {|f| f.puts "gemspec" } + sys_exec "rm -rf .git && git init", :dir => lib_path("foo") end it "does not output git errors" do - bundle :show + bundle :show, :dir => lib_path("foo") expect(err_without_deprecations).to be_empty end end @@ -161,19 +160,19 @@ RSpec.describe "bundle show", :bundler => "< 3" do G bundle "config set auto_install 1" - bundle :show + bundle! :show expect(out).to include("Installing foo 1.0") end context "with a valid regexp for gem name" do - it "presents alternatives" do + it "presents alternatives", :readline do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" gem "rack-obama" G - bundle "show rac" + bundle! "show rac" expect(out).to eq "1 : rack\n2 : rack-obama\n0 : - exit -\n>" end end @@ -193,7 +192,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end context "--outdated option" do - # Regression test for https://github.com/bundler/bundler/issues/5375 + # Regression test for https://github.com/rubygems/bundler/issues/5375 before do build_repo2 end |