diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-08-02 15:01:29 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-08-02 15:04:28 -0500 |
commit | 220695122ff4de38a941afb8153f18f8b6667658 (patch) | |
tree | 03208226045886acf6801f4cb5fbd81e93c2b494 | |
parent | 9d43a0504023926e8457832d0841d8d44a6217c5 (diff) | |
download | bundler-220695122ff4de38a941afb8153f18f8b6667658.tar.gz |
Use `include_gem` as the matcher name
50 files changed, 398 insertions, 397 deletions
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index 135d4a2137..ac704fb41d 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -35,7 +35,7 @@ describe "bundle executable" do bundle :install, :env => { "BUNDLE_GEMFILE" => "" } - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb index ad175fe2e3..474233a83c 100644 --- a/spec/cache/gems_spec.rb +++ b/spec/cache/gems_spec.rb @@ -24,14 +24,14 @@ describe "bundle cache" do gem "omg" G - expect(the_bundle).to have_installed "omg 1.0.0" + expect(the_bundle).to include_gems "omg 1.0.0" end it "uses the cache as a source when installing gems with --local" do system_gems [] bundle "install --local" - expect(the_bundle).to have_installed("rack 1.0.0") + expect(the_bundle).to include_gems("rack 1.0.0") end it "does not reinstall gems from the cache if they exist on the system" do @@ -43,7 +43,7 @@ describe "bundle cache" do gem "rack" G - expect(the_bundle).to have_installed("rack 1.0.0") + expect(the_bundle).to include_gems("rack 1.0.0") end it "does not reinstall gems from the cache if they exist in the bundle" do @@ -58,7 +58,7 @@ describe "bundle cache" do end bundle "install --local" - expect(the_bundle).to have_installed("rack 1.0.0") + expect(the_bundle).to include_gems("rack 1.0.0") end it "creates a lockfile" do @@ -89,7 +89,7 @@ describe "bundle cache" do it "uses builtin gems" do install_gemfile %(gem 'builtin_gem', '1.0.2') - expect(the_bundle).to have_installed("builtin_gem 1.0.2") + expect(the_bundle).to include_gems("builtin_gem 1.0.2") end it "caches remote and builtin gems" do @@ -115,7 +115,7 @@ describe "bundle cache" do G bundle "install --local" - expect(the_bundle).to have_installed("builtin_gem_2 1.0.2") + expect(the_bundle).to include_gems("builtin_gem_2 1.0.2") end it "errors if the builtin gem isn't available to cache" do @@ -149,7 +149,7 @@ describe "bundle cache" do system_gems [] bundle "install --local" - expect(the_bundle).to have_installed("rack 1.0.0", "foo 1.0") + expect(the_bundle).to include_gems("rack 1.0.0", "foo 1.0") end it "should not explode if the lockfile is not present" do @@ -286,7 +286,7 @@ describe "bundle cache" do gem "foo-bundler" G - expect(the_bundle).to have_installed "foo-bundler 1.0" + expect(the_bundle).to include_gems "foo-bundler 1.0" end end end diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb index 89d4b5c74d..847a39d0a7 100644 --- a/spec/cache/git_spec.rb +++ b/spec/cache/git_spec.rb @@ -29,7 +29,7 @@ end expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file FileUtils.rm_rf lib_path("foo-1.0") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "copies repository to vendor cache and uses it even when installed with bundle --path" do @@ -47,7 +47,7 @@ end expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist FileUtils.rm_rf lib_path("foo-1.0") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "runs twice without exploding" do @@ -62,7 +62,7 @@ end expect(err).to lack_errors FileUtils.rm_rf lib_path("foo-1.0") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "tracks updates" do @@ -139,7 +139,7 @@ end expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}")).to exist expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0")).to exist - expect(the_bundle).to have_installed "has_submodule 1.0" + expect(the_bundle).to include_gems "has_submodule 1.0" end it "displays warning message when detecting git repo in Gemfile" do diff --git a/spec/cache/path_spec.rb b/spec/cache/path_spec.rb index 72b12948f4..4233b3e88b 100644 --- a/spec/cache/path_spec.rb +++ b/spec/cache/path_spec.rb @@ -12,7 +12,7 @@ require "spec_helper" bundle "#{cmd} --all" expect(bundled_app("vendor/cache/foo-1.0")).not_to exist - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "copies when the path is outside the bundle " do @@ -27,7 +27,7 @@ require "spec_helper" expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file FileUtils.rm_rf lib_path("foo-1.0") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "copies when the path is outside the bundle and the paths intersect" do @@ -45,7 +45,7 @@ require "spec_helper" expect(bundled_app("vendor/cache/#{libname}/.bundlecache")).to be_file FileUtils.rm_rf libpath - expect(the_bundle).to have_installed "#{libname} 1.0" + expect(the_bundle).to include_gems "#{libname} 1.0" end it "updates the path on each cache" do diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index 1f8a3bd508..35c9d187a0 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -244,7 +244,7 @@ describe "bundle binstubs <gem>" do bundle "config auto_install 1" bundle "binstubs rack" expect(out).to include("Installing rack 1.0.0") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "does nothing when already up to date" do diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index 375c5727b1..b7a1d55172 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -16,7 +16,7 @@ describe ".bundle/config" do expect(bundled_app(".bundle")).not_to exist expect(tmp("foo/bar/config")).to exist - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "can provide a relative path with the environment variable" do @@ -28,7 +28,7 @@ describe ".bundle/config" do expect(bundled_app(".bundle")).not_to exist expect(bundled_app("../foo/config")).to exist - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "removes environment.rb from BUNDLE_APP_CONFIG's path" do @@ -36,7 +36,7 @@ describe ".bundle/config" do ENV["BUNDLE_APP_CONFIG"] = tmp("foo/bar").to_s bundle "install" FileUtils.touch tmp("foo/bar/environment.rb") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(tmp("foo/bar/environment.rb")).not_to exist end end diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb index a727b43e73..131b47368b 100644 --- a/spec/commands/console_spec.rb +++ b/spec/commands/console_spec.rb @@ -102,6 +102,6 @@ describe "bundle console" do end expect(out).to include("Installing foo 1.0") expect(out).to include("hello") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end end diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index df3e08fd36..c9ca712fa5 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -151,7 +151,7 @@ describe "bundle exec" do bundle "exec rackup" expect(out).to eq("0.9.1") - expect(the_bundle).not_to have_installed "rack_middleware 1.0" + expect(the_bundle).not_to include_gems "rack_middleware 1.0" end it "does not duplicate already exec'ed RUBYOPT" do diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index 8f09689785..14d47cbb88 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -83,7 +83,7 @@ describe "bundle install with gem sources" do G expect(default_bundle_path("gems/rack-1.0.0")).to exist - expect(the_bundle).to have_installed("rack 1.0.0") + expect(the_bundle).to include_gems("rack 1.0.0") end it "fetches gems when multiple versions are specified" do @@ -93,7 +93,7 @@ describe "bundle install with gem sources" do G expect(default_bundle_path("gems/rack-0.9.1")).to exist - expect(the_bundle).to have_installed("rack 0.9.1") + expect(the_bundle).to include_gems("rack 0.9.1") end it "fetches gems when multiple versions are specified take 2" do @@ -103,7 +103,7 @@ describe "bundle install with gem sources" do G expect(default_bundle_path("gems/rack-0.9.1")).to exist - expect(the_bundle).to have_installed("rack 0.9.1") + expect(the_bundle).to include_gems("rack 0.9.1") end it "raises an appropriate error when gems are specified using symbols" do @@ -120,7 +120,7 @@ describe "bundle install with gem sources" do gem "rails" G - expect(the_bundle).to have_installed "actionpack 2.3.2", "rails 2.3.2" + expect(the_bundle).to include_gems "actionpack 2.3.2", "rails 2.3.2" end it "does the right version" do @@ -129,7 +129,7 @@ describe "bundle install with gem sources" do gem "rack", "0.9.1" G - expect(the_bundle).to have_installed "rack 0.9.1" + expect(the_bundle).to include_gems "rack 0.9.1" end it "does not install the development dependency" do @@ -138,8 +138,8 @@ describe "bundle install with gem sources" do gem "with_development_dependency" G - expect(the_bundle).to have_installed("with_development_dependency 1.0.0"). - and not_have_installed("activesupport 2.3.5") + expect(the_bundle).to include_gems("with_development_dependency 1.0.0"). + and not_include_gems("activesupport 2.3.5") end it "resolves correctly" do @@ -149,7 +149,7 @@ describe "bundle install with gem sources" do gem "rails" G - expect(the_bundle).to have_installed "activemerchant 1.0", "activesupport 2.3.2", "actionpack 2.3.2" + expect(the_bundle).to include_gems "activemerchant 1.0", "activesupport 2.3.2", "actionpack 2.3.2" end it "activates gem correctly according to the resolved gems" do @@ -164,7 +164,7 @@ describe "bundle install with gem sources" do gem "rails" G - expect(the_bundle).to have_installed "activemerchant 1.0", "activesupport 2.3.2", "actionpack 2.3.2" + expect(the_bundle).to include_gems "activemerchant 1.0", "activesupport 2.3.2", "actionpack 2.3.2" end it "does not reinstall any gem that is already available locally" do @@ -181,7 +181,7 @@ describe "bundle install with gem sources" do gem "activerecord", "2.3.2" G - expect(the_bundle).to have_installed "activesupport 2.3.2" + expect(the_bundle).to include_gems "activesupport 2.3.2" end it "works when the gemfile specifies gems that only exist in the system" do @@ -192,7 +192,7 @@ describe "bundle install with gem sources" do gem "foo" G - expect(the_bundle).to have_installed "rack 1.0.0", "foo 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0", "foo 1.0.0" end it "prioritizes local gems over remote gems" do @@ -205,7 +205,7 @@ describe "bundle install with gem sources" do gem "rack" G - expect(the_bundle).to have_installed "rack 1.0.0", "activesupport 2.3.5" + expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5" end describe "with a gem that installs multiple platforms" do @@ -264,21 +264,21 @@ describe "bundle install with gem sources" do it "works" do bundle "install --path vendor" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "allows running bundle install --system without deleting foo" do bundle "install --path vendor" bundle "install --system" FileUtils.rm_rf(bundled_app("vendor")) - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "allows running bundle install --system after deleting foo" do bundle "install --path vendor" FileUtils.rm_rf(bundled_app("vendor")) bundle "install --system" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -294,7 +294,7 @@ describe "bundle install with gem sources" do gem "rack", "1.2" G - expect(the_bundle).to have_installed "rack 1.2", "activesupport 1.2.3" + expect(the_bundle).to include_gems "rack 1.2", "activesupport 1.2.3" end it "gives a useful error if no sources are set" do diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb index 4dfe47ab1d..51ce433966 100644 --- a/spec/commands/package_spec.rb +++ b/spec/commands/package_spec.rb @@ -12,7 +12,7 @@ describe "bundle package" do bundle "package --gemfile=NotGemfile" ENV["BUNDLE_GEMFILE"] = "NotGemfile" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -151,7 +151,7 @@ describe "bundle package" do bundle "package --path=#{bundled_app("test")}" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(bundled_app("test/vendor/cache/")).to exist end end @@ -165,7 +165,7 @@ describe "bundle package" do bundle "package --no-install" - expect(the_bundle).not_to have_installed "rack 1.0.0", :expect_err => true + expect(the_bundle).not_to include_gems "rack 1.0.0", :expect_err => true expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist end @@ -178,7 +178,7 @@ describe "bundle package" do bundle "package --no-install" bundle "install" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -236,7 +236,7 @@ describe "bundle install with gem sources" do FileUtils.rm_rf gem_repo2 bundle "install --local" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "does not hit the remote at all" do @@ -251,7 +251,7 @@ describe "bundle install with gem sources" do FileUtils.rm_rf gem_repo2 bundle "install --deployment" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "does not reinstall already-installed gems" do @@ -267,7 +267,7 @@ describe "bundle install with gem sources" do bundle :install expect(err).to lack_errors - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "ignores cached gems for the wrong platform" do diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 163c64fb67..84352c5427 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -80,7 +80,7 @@ describe "bundle show" do install_gemfile <<-G gem "foo", :git => "#{lib_path("foo-1.0")}" G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" bundle :show expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") @@ -95,7 +95,7 @@ describe "bundle show" do install_gemfile <<-G gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg" G - expect(the_bundle).to have_installed "foo 1.0.omg" + expect(the_bundle).to include_gems "foo 1.0.omg" bundle :show expect(out).to include("foo (1.0 #{@git.ref_for("omg", 6)}") @@ -116,7 +116,7 @@ describe "bundle show" do install_gemfile <<-G gem "foo", "1.0.0-beta.1", :git => "#{lib_path("foo")}" G - expect(the_bundle).to have_installed "foo 1.0.0.pre.beta.1" + expect(the_bundle).to include_gems "foo 1.0.0.pre.beta.1" bundle! :show expect(out).to include("foo (1.0.0.pre.beta.1") diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb index 24a3148b70..3c1cb566af 100644 --- a/spec/commands/update_spec.rb +++ b/spec/commands/update_spec.rb @@ -20,7 +20,7 @@ describe "bundle update" do bundle "update" expect(out).to include("Bundle updated!") - expect(the_bundle).to have_installed "rack 1.2", "rack-obama 1.0", "activesupport 3.0" + expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0" end it "doesn't delete the Gemfile.lock file if something goes wrong" do @@ -49,7 +49,7 @@ describe "bundle update" do end bundle "update rack-obama" - expect(the_bundle).to have_installed "rack 1.2", "rack-obama 1.0", "activesupport 2.3.5" + expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 2.3.5" end end @@ -68,7 +68,7 @@ describe "bundle update" do it "should update the child dependency" do update_repo2 bundle "update rack" - expect(the_bundle).to have_installed "rack 1.2" + expect(the_bundle).to include_gems "rack 1.2" end end @@ -92,8 +92,8 @@ describe "bundle update" do build_gem "activesupport", "3.0" end bundle "update --group development" - expect(the_bundle).to have_installed "activesupport 3.0" - expect(the_bundle).not_to have_installed "rack 1.2" + expect(the_bundle).to include_gems "activesupport 3.0" + expect(the_bundle).not_to include_gems "rack 1.2" end context "when there is a source with the same name as a gem in a group" do @@ -111,8 +111,8 @@ describe "bundle update" do update_git "foo", "2.0", :path => lib_path("activesupport") bundle "update --group development" - expect(the_bundle).to have_installed "activesupport 3.0" - expect(the_bundle).not_to have_installed "foo 2.0" + expect(the_bundle).to include_gems "activesupport 3.0" + expect(the_bundle).not_to include_gems "foo 2.0" end end end @@ -138,7 +138,7 @@ describe "bundle update" do update_repo2 { build_gem "activesupport", "3.0" } bundle "update --source activesupport" - expect(the_bundle).not_to have_installed "activesupport 3.0" + expect(the_bundle).not_to include_gems "activesupport 3.0" end it "should update gems not included in the source that happen to have the same name" do @@ -149,7 +149,7 @@ describe "bundle update" do update_repo2 { build_gem "activesupport", "3.0" } bundle "update --source activesupport" - expect(the_bundle).to have_installed "activesupport 3.0" + expect(the_bundle).to include_gems "activesupport 3.0" end end @@ -178,8 +178,8 @@ describe "bundle update" do end bundle "update --source harry" - expect(the_bundle).to have_installed "harry 2.0" - expect(the_bundle).to have_installed "fred 1.0" + expect(the_bundle).to include_gems "harry 2.0" + expect(the_bundle).to include_gems "fred 1.0" end end @@ -211,9 +211,9 @@ describe "bundle update" do end bundle "update --source harry" - expect(the_bundle).to have_installed "harry 2.0" - expect(the_bundle).to have_installed "fred 1.0" - expect(the_bundle).to have_installed "george 1.0" + expect(the_bundle).to include_gems "harry 2.0" + expect(the_bundle).to include_gems "fred 1.0" + expect(the_bundle).to include_gems "george 1.0" end end end @@ -238,7 +238,7 @@ describe "bundle update in more complicated situations" do end bundle "update thin" - expect(the_bundle).to have_installed "thin 2.0", "rack 1.2", "rack-obama 1.0" + expect(the_bundle).to include_gems "thin 2.0", "rack 1.2", "rack-obama 1.0" end it "will update only from pinned source" do @@ -255,7 +255,7 @@ describe "bundle update in more complicated situations" do end bundle "update" - expect(the_bundle).to have_installed "thin 1.0" + expect(the_bundle).to include_gems "thin 1.0" end end @@ -271,7 +271,7 @@ describe "bundle update without a Gemfile.lock" do bundle "update" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -481,13 +481,13 @@ describe "bundle update conservative" do it "single gem updates dependent gem to minor" do bundle "update --patch foo" - expect(the_bundle).to have_installed "foo 1.4.5", "bar 2.1.1", "qux 1.0.0" + expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.0" end it "update all" do bundle "update --patch" - expect(the_bundle).to have_installed "foo 1.4.5", "bar 2.1.1", "qux 1.0.1" + expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.1" end it "warns on minor or major increment elsewhere" ## include in prior test @@ -497,7 +497,7 @@ describe "bundle update conservative" do it "single gem updates dependent gem to major" do bundle "update --minor foo" - expect(the_bundle).to have_installed "foo 1.5.1", "bar 3.0.0", "qux 1.0.0" + expect(the_bundle).to include_gems "foo 1.5.1", "bar 3.0.0", "qux 1.0.0" end it "warns on major increment elsewhere" ## include in prior test @@ -509,13 +509,13 @@ describe "bundle update conservative" do it "patch preferred" do bundle "update --patch foo bar --strict" - expect(the_bundle).to have_installed "foo 1.4.4", "bar 2.0.5", "qux 1.0.0" + expect(the_bundle).to include_gems "foo 1.4.4", "bar 2.0.5", "qux 1.0.0" end it "minor preferred" do bundle "update --minor --strict" - expect(the_bundle).to have_installed "foo 1.5.0", "bar 2.1.1", "qux 1.1.0" + expect(the_bundle).to include_gems "foo 1.5.0", "bar 2.1.1", "qux 1.1.0" end end diff --git a/spec/install/binstubs_spec.rb b/spec/install/binstubs_spec.rb index 814732fd12..a7e0b847cc 100644 --- a/spec/install/binstubs_spec.rb +++ b/spec/install/binstubs_spec.rb @@ -16,7 +16,7 @@ describe "bundle install" do config "BUNDLE_SYSTEM_BINDIR" => system_gem_path("altbin").to_s bundle :install - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(system_gem_path("altbin/rackup")).to exist end end diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb index 688f855d68..9f06a48086 100644 --- a/spec/install/bundler_spec.rb +++ b/spec/install/bundler_spec.rb @@ -19,7 +19,7 @@ describe "bundle install" do gem "rails", "3.0" G - expect(the_bundle).to have_installed "bundler #{Bundler::VERSION}" + expect(the_bundle).to include_gems "bundler #{Bundler::VERSION}" end it "are not added if not already present" do @@ -27,7 +27,7 @@ describe "bundle install" do source "file://#{gem_repo1}" gem "rack" G - expect(the_bundle).not_to have_installed "bundler #{Bundler::VERSION}" + expect(the_bundle).not_to include_gems "bundler #{Bundler::VERSION}" end it "causes a conflict if explicitly requesting a different version" do @@ -71,7 +71,7 @@ describe "bundle install" do gem "rack" G - expect(the_bundle).to have_installed "multiple_versioned_deps 1.0.0" + expect(the_bundle).to include_gems "multiple_versioned_deps 1.0.0" end it "includes bundler in the bundle when it's a child dependency" do diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index 8bcd65a4d8..c73cff5e80 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -38,7 +38,7 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" bundle :install expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "still works if you are not in the app directory and specify --gemfile" do @@ -47,7 +47,7 @@ describe "install with --deployment or --frozen" do simulate_new_machine bundle "install --gemfile #{tmp}/bundled_app/Gemfile --deployment" Dir.chdir bundled_app - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "works if you exclude a group with a git gem" do @@ -105,7 +105,7 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end describe "with an existing lockfile" do @@ -260,7 +260,7 @@ describe "install with --deployment or --frozen" do gem "rack-obama" G - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -272,7 +272,7 @@ describe "install with --deployment or --frozen" do G bundle :install - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" bundle "package --all" expect(bundled_app("vendor/cache/foo")).to be_directory @@ -288,7 +288,7 @@ describe "install with --deployment or --frozen" do expect(out).not_to include("You have deleted from the Gemfile") expect(out).to include("Using foo 1.0 from source at") expect(out).to include("vendor/cache/foo") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end end end diff --git a/spec/install/force_spec.rb b/spec/install/force_spec.rb index 3d38dbeeec..2027660cba 100644 --- a/spec/install/force_spec.rb +++ b/spec/install/force_spec.rb @@ -21,7 +21,7 @@ describe "bundle install" do expect(out).to include "Using bundler" expect(out).to include "Installing rack 1.0.0" expect(rack_lib.open(&:read)).to eq("RACK = '1.0.0'\n") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "works on first bundle install" do @@ -30,7 +30,7 @@ describe "bundle install" do expect(exitstatus).to eq(0) if exitstatus expect(out).to include "Using bundler" expect(out).to include "Installing rack 1.0.0" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 216827753e..d54fae1f6a 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -18,8 +18,8 @@ describe "bundle install from an existing gemspec" do gemspec :path => '#{tmp.join("foo")}' G - expect(the_bundle).to have_installed "bar 1.0.0" - expect(the_bundle).to have_installed "bar-dev 1.0.0", :groups => :development + expect(the_bundle).to include_gems "bar 1.0.0" + expect(the_bundle).to include_gems "bar-dev 1.0.0", :groups => :development end it "that is hidden should install runtime and development dependencies" do @@ -35,8 +35,8 @@ describe "bundle install from an existing gemspec" do gemspec :path => '#{tmp.join("foo")}' G - expect(the_bundle).to have_installed "bar 1.0.0" - expect(the_bundle).to have_installed "bar-dev 1.0.0", :groups => :development + expect(the_bundle).to include_gems "bar 1.0.0" + expect(the_bundle).to include_gems "bar-dev 1.0.0", :groups => :development end it "should handle a list of requirements" do @@ -52,7 +52,7 @@ describe "bundle install from an existing gemspec" do gemspec :path => '#{tmp.join("foo")}' G - expect(the_bundle).to have_installed "baz 1.0" + expect(the_bundle).to include_gems "baz 1.0" end it "should raise if there are no gemspecs available" do @@ -89,8 +89,8 @@ describe "bundle install from an existing gemspec" do gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G - expect(the_bundle).to have_installed "bar 1.0.0" - expect(the_bundle).to have_installed "bar-dev 1.0.0", :groups => :development + expect(the_bundle).to include_gems "bar 1.0.0" + expect(the_bundle).to include_gems "bar-dev 1.0.0", :groups => :development end it "should use a specific group for development dependencies" do @@ -105,9 +105,9 @@ describe "bundle install from an existing gemspec" do gemspec :path => '#{tmp.join("foo")}', :name => 'foo', :development_group => :dev G - expect(the_bundle).to have_installed "bar 1.0.0" - expect(the_bundle).not_to have_installed "bar-dev 1.0.0", :groups => :development - expect(the_bundle).to have_installed "bar-dev 1.0.0", :groups => :dev + expect(the_bundle).to include_gems "bar 1.0.0" + expect(the_bundle).not_to include_gems "bar-dev 1.0.0", :groups => :development + expect(the_bundle).to include_gems "bar-dev 1.0.0", :groups => :dev end it "should match a lockfile even if the gemspec defines development dependencies" do @@ -159,7 +159,7 @@ describe "bundle install from an existing gemspec" do gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G - expect(the_bundle).to have_installed "foo 1.0.0" + expect(the_bundle).to include_gems "foo 1.0.0" end context "when child gemspecs conflict with a released gemspec" do @@ -182,7 +182,7 @@ describe "bundle install from an existing gemspec" do gemspec G - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -246,7 +246,7 @@ describe "bundle install from an existing gemspec" do simulate_platform "java" do results = bundle "install", :artifice => "endpoint" expect(results).to include("Installing rack 1.0.0") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end @@ -260,7 +260,7 @@ describe "bundle install from an existing gemspec" do simulate_platform "java" do results = bundle "install", :artifice => "endpoint" expect(results).to include("Installing rack 1.0.0") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end @@ -271,7 +271,7 @@ describe "bundle install from an existing gemspec" do simulate_windows do results = bundle "install", :artifice => "endpoint" expect(results).to include("Installing rack 1.0.0") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end @@ -315,7 +315,7 @@ describe "bundle install from an existing gemspec" do context "as a runtime dependency" do it "keeps java dependencies in the lockfile" do - expect(the_bundle).to have_installed "foo 1.0", "platform_specific 1.0 RUBY" + expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY" expect(lockfile).to eq strip_whitespace(<<-L) PATH remote: . @@ -346,7 +346,7 @@ describe "bundle install from an existing gemspec" do let(:platform_specific_type) { :development } it "keeps java dependencies in the lockfile" do - expect(the_bundle).to have_installed "foo 1.0", "platform_specific 1.0 RUBY" + expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY" expect(lockfile).to eq strip_whitespace(<<-L) PATH remote: . @@ -378,7 +378,7 @@ describe "bundle install from an existing gemspec" do let(:dependency) { "indirect_platform_specific" } it "keeps java dependencies in the lockfile" do - expect(the_bundle).to have_installed "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY" + expect(the_bundle).to include_gems "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY" expect(lockfile).to eq strip_whitespace(<<-L) PATH remote: . diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index 176721c6e5..84db927403 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -17,7 +17,7 @@ describe "bundle install with git sources" do end it "fetches gems" do - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") run <<-RUBY require 'foo' @@ -126,7 +126,7 @@ describe "bundle install with git sources" do FileUtils.mv bundled_app, tmp("bundled_app.bck") Dir.chdir tmp("bundled_app.bck") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "can still install after moving the application directory" do @@ -147,7 +147,7 @@ describe "bundle install with git sources" do bundle "update foo" - expect(the_bundle).to have_installed "foo 1.1", "rack 1.0" + expect(the_bundle).to include_gems "foo 1.1", "rack 1.0" end end @@ -166,7 +166,7 @@ describe "bundle install with git sources" do it "does not explode" do bundle "install" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -398,7 +398,7 @@ describe "bundle install with git sources" do gem "rack", :git => "#{lib_path("rack-0.8")}" G - expect(the_bundle).to have_installed "rack 0.8" + expect(the_bundle).to include_gems "rack 0.8" end it "installs dependencies from git even if a newer gem is available elsewhere" do @@ -434,7 +434,7 @@ describe "bundle install with git sources" do gem "rack", "1.0.0", :git => "#{lib_path("rack")}" G - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "correctly unlocks when changing to a git source without versions" do @@ -450,7 +450,7 @@ describe "bundle install with git sources" do gem "rack", :git => "#{lib_path("rack")}" G - expect(the_bundle).to have_installed "rack 1.2" + expect(the_bundle).to include_gems "rack 1.2" end end @@ -466,7 +466,7 @@ describe "bundle install with git sources" do end G - expect(the_bundle).to have_installed "omg 1.0", "hi2u 1.0" + expect(the_bundle).to include_gems "omg 1.0", "hi2u 1.0" end end @@ -498,8 +498,8 @@ describe "bundle install with git sources" do gem "rails", "2.3.2" G - expect(the_bundle).to have_installed "foo 1.0" - expect(the_bundle).to have_installed "rails 2.3.2" + expect(the_bundle).to include_gems "foo 1.0" + expect(the_bundle).to include_gems "rails 2.3.2" end it "runs the gemspec in the context of its parent directory" do @@ -528,8 +528,8 @@ describe "bundle install with git sources" do gem "rails", "2.3.2" G - expect(the_bundle).to have_installed "bar 1.0" - expect(the_bundle).to have_installed "rails 2.3.2" + expect(the_bundle).to include_gems "bar 1.0" + expect(the_bundle).to include_gems "rails 2.3.2" end it "installs from git even if a rubygems gem is present" do @@ -543,7 +543,7 @@ describe "bundle install with git sources" do gem "foo", "1.0", :git => "#{lib_path("foo-1.0")}" G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "fakes the gem out if there is no gemspec" do @@ -555,8 +555,8 @@ describe "bundle install with git sources" do gem "rails", "2.3.2" G - expect(the_bundle).to have_installed("foo 1.0") - expect(the_bundle).to have_installed("rails 2.3.2") + expect(the_bundle).to include_gems("foo 1.0") + expect(the_bundle).to include_gems("rails 2.3.2") end it "catches git errors and spits out useful output" do @@ -578,7 +578,7 @@ describe "bundle install with git sources" do gem "foo", :git => "#{lib_path("foo space-1.0")}" G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "handles repos that have been force-pushed" do @@ -589,21 +589,21 @@ describe "bundle install with git sources" do gem 'forced' end G - expect(the_bundle).to have_installed "forced 1.0" + expect(the_bundle).to include_gems "forced 1.0" update_git "forced" do |s| s.write "lib/forced.rb", "FORCED = '1.1'" end bundle "update" - expect(the_bundle).to have_installed "forced 1.1" + expect(the_bundle).to include_gems "forced 1.1" Dir.chdir(lib_path("forced-1.0")) do `git reset --hard HEAD^` end bundle "update" - expect(the_bundle).to have_installed "forced 1.0" + expect(the_bundle).to include_gems "forced 1.0" end it "ignores submodules if :submodule is not passed" do @@ -623,7 +623,7 @@ describe "bundle install with git sources" do G expect(out).to match(/could not find gem 'submodule/i) - expect(the_bundle).not_to have_installed "has_submodule 1.0", :expect_err => true + expect(the_bundle).not_to include_gems "has_submodule 1.0", :expect_err => true end it "handles repos with submodules" do @@ -642,7 +642,7 @@ describe "bundle install with git sources" do end G - expect(the_bundle).to have_installed "has_submodule 1.0" + expect(the_bundle).to include_gems "has_submodule 1.0" end it "handles implicit updates when modifying the source info" do @@ -747,7 +747,7 @@ describe "bundle install with git sources" do gem "bar", :git => "#{lib_path("bar")}" G - expect(the_bundle).to have_installed "foo 1.0", "bar 1.0" + expect(the_bundle).to include_gems "foo 1.0", "bar 1.0" end it "doesn't explode when switching Gem to Git source" do @@ -1097,7 +1097,7 @@ describe "bundle install with git sources" do G bundle :install - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end end end diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb index c338cc5d62..cb052b6c7a 100644 --- a/spec/install/gemfile/groups_spec.rb +++ b/spec/install/gemfile/groups_spec.rb @@ -15,11 +15,11 @@ describe "bundle install with groups" do end it "installs gems in the default group" do - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "installs gems in a group block into that group" do - expect(the_bundle).to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "activesupport 2.3.5" load_error_run <<-R, "activesupport", :default require 'activesupport' @@ -30,7 +30,7 @@ describe "bundle install with groups" do end it "installs gems with inline :groups into those groups" do - expect(the_bundle).to have_installed "thin 1.0" + expect(the_bundle).to include_gems "thin 1.0" load_error_run <<-R, "thin", :default require 'thin' @@ -88,19 +88,19 @@ describe "bundle install with groups" do it "installs gems in the default group" do bundle :install, :without => "emo" - expect(the_bundle).to have_installed "rack 1.0.0", :groups => [:default] + expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default] end it "does not install gems from the excluded group" do bundle :install, :without => "emo" - expect(the_bundle).not_to have_installed "activesupport 2.3.5", :groups => [:default] + expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default] end it "does not install gems from the previously excluded group" do bundle :install, :without => "emo" - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" bundle :install - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" end it "does not say it installed gems from the excluded group" do @@ -124,7 +124,7 @@ describe "bundle install with groups" do G bundle :install, :without => "emo" - expect(the_bundle).to have_installed "activesupport 2.3.2", :groups => [:default] + expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => [:default] end it "still works on a different machine and excludes gems" do @@ -133,8 +133,8 @@ describe "bundle install with groups" do simulate_new_machine bundle :install, :without => "emo" - expect(the_bundle).to have_installed "rack 1.0.0", :groups => [:default] - expect(the_bundle).not_to have_installed "activesupport 2.3.5", :groups => [:default] + expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default] + expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default] end it "still works when BUNDLE_WITHOUT is set" do @@ -143,8 +143,8 @@ describe "bundle install with groups" do bundle :install expect(out).not_to include("activesupport") - expect(the_bundle).to have_installed "rack 1.0.0", :groups => [:default] - expect(the_bundle).not_to have_installed "activesupport 2.3.5", :groups => [:default] + expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default] + expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default] ENV["BUNDLE_WITHOUT"] = nil end @@ -153,56 +153,56 @@ describe "bundle install with groups" do bundle :install, :without => "emo" bundle 'install --without ""' - expect(the_bundle).to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "activesupport 2.3.5" end it "doesn't clear without when nothing is passed" do bundle :install, :without => "emo" bundle :install - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" end it "does not install gems from the optional group" do bundle :install - expect(the_bundle).not_to have_installed "thin 1.0" + expect(the_bundle).not_to include_gems "thin 1.0" end it "does install gems from the optional group when requested" do bundle :install, :with => "debugging" - expect(the_bundle).to have_installed "thin 1.0" + expect(the_bundle).to include_gems "thin 1.0" end it "does install gems from the previously requested group" do bundle :install, :with => "debugging" - expect(the_bundle).to have_installed "thin 1.0" + expect(the_bundle).to include_gems "thin 1.0" bundle :install - expect(the_bundle).to have_installed "thin 1.0" + expect(the_bundle).to include_gems "thin 1.0" end it "does install gems from the optional groups requested with BUNDLE_WITH" do ENV["BUNDLE_WITH"] = "debugging" bundle :install - expect(the_bundle).to have_installed "thin 1.0" + expect(the_bundle).to include_gems "thin 1.0" ENV["BUNDLE_WITH"] = nil end it "clears with when passed an empty list" do bundle :install, :with => "debugging" bundle 'install --with ""' - expect(the_bundle).not_to have_installed "thin 1.0" + expect(the_bundle).not_to include_gems "thin 1.0" end it "does remove groups from without when passed at with" do bundle :install, :without => "emo" bundle :install, :with => "emo" - expect(the_bundle).to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "activesupport 2.3.5" end it "does remove groups from with when passed at without" do bundle :install, :with => "debugging" bundle :install, :without => "debugging" - expect(the_bundle).not_to have_installed "thin 1.0" + expect(the_bundle).not_to include_gems "thin 1.0" end it "errors out when passing a group to with and without" do @@ -212,18 +212,18 @@ describe "bundle install with groups" do it "can add and remove a group at the same time" do bundle :install, :with => "debugging", :without => "emo" - expect(the_bundle).to have_installed "thin 1.0" - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "thin 1.0" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" end it "does have no effect when listing a not optional group in with" do bundle :install, :with => "emo" - expect(the_bundle).to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "activesupport 2.3.5" end it "does have no effect when listing an optional group in without" do bundle :install, :without => "debugging" - expect(the_bundle).not_to have_installed "thin 1.0" + expect(the_bundle).not_to include_gems "thin 1.0" end end @@ -240,12 +240,12 @@ describe "bundle install with groups" do it "installs gems in the default group" do bundle :install, :without => "emo lolercoaster" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "installs the gem if any of its groups are installed" do bundle "install --without emo" - expect(the_bundle).to have_installed "rack 1.0.0", "activesupport 2.3.5" + expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5" end describe "with a gem defined multiple times in different groups" do @@ -266,22 +266,22 @@ describe "bundle install with groups" do it "installs the gem w/ option --without emo" do bundle "install --without emo" - expect(the_bundle).to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "activesupport 2.3.5" end it "installs the gem w/ option --without lolercoaster" do bundle "install --without lolercoaster" - expect(the_bundle).to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "activesupport 2.3.5" end it "does not install the gem w/ option --without emo lolercoaster" do bundle "install --without emo lolercoaster" - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" end it "does not install the gem w/ option --without 'emo lolercoaster'" do bundle "install --without 'emo lolercoaster'" - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" end end end @@ -301,12 +301,12 @@ describe "bundle install with groups" do it "installs gems in the default group" do bundle :install, :without => "emo lolercoaster" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "installs the gem if any of its groups are installed" do bundle "install --without emo" - expect(the_bundle).to have_installed "rack 1.0.0", "activesupport 2.3.5" + expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5" end end end @@ -352,14 +352,14 @@ describe "bundle install with groups" do end it "uses the correct versions even if --without was used on the original" do - expect(the_bundle).to have_installed "rack 0.9.1" - expect(the_bundle).not_to have_installed "rack_middleware 1.0" + expect(the_bundle).to include_gems "rack 0.9.1" + expect(the_bundle).not_to include_gems "rack_middleware 1.0" simulate_new_machine bundle :install - expect(the_bundle).to have_installed "rack 0.9.1" - expect(the_bundle).to have_installed "rack_middleware 1.0" + expect(the_bundle).to include_gems "rack 0.9.1" + expect(the_bundle).to include_gems "rack_middleware 1.0" end it "does not hit the remote a second time" do diff --git a/spec/install/gemfile/install_if.rb b/spec/install/gemfile/install_if.rb index 4140ad6f37..b1717ad583 100644 --- a/spec/install/gemfile/install_if.rb +++ b/spec/install/gemfile/install_if.rb @@ -15,9 +15,9 @@ describe "bundle install with install_if conditionals" do gem "rack" G - expect(the_bundle).to have_installed("rack 1.0", "activesupport 2.3.5") - expect(the_bundle).not_to have_installed("thin") - expect(the_bundle).not_to have_installed("foo") + expect(the_bundle).to include_gems("rack 1.0", "activesupport 2.3.5") + expect(the_bundle).not_to include_gems("thin") + expect(the_bundle).not_to include_gems("foo") lockfile_should_be <<-L GEM diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb index 60b024919d..cc09b6f680 100644 --- a/spec/install/gemfile/path_spec.rb +++ b/spec/install/gemfile/path_spec.rb @@ -10,7 +10,7 @@ describe "bundle install with explicit source paths" do gem 'foo' G - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") end it "supports pinned paths" do @@ -20,7 +20,7 @@ describe "bundle install with explicit source paths" do gem 'foo', :path => "#{lib_path("foo-1.0")}" G - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") end it "supports relative paths" do @@ -32,7 +32,7 @@ describe "bundle install with explicit source paths" do gem 'foo', :path => "#{relative_path}" G - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") end it "expands paths" do @@ -44,7 +44,7 @@ describe "bundle install with explicit source paths" do gem 'foo', :path => "~/#{relative_path}" G - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") end it "expands paths raise error with not existing user's home dir" do @@ -68,7 +68,7 @@ describe "bundle install with explicit source paths" do bundled_app("subdir").mkpath Dir.chdir(bundled_app("subdir")) do - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") end end @@ -118,7 +118,7 @@ describe "bundle install with explicit source paths" do gem "omg", :path => "#{lib_path("omg")}" G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "prefers gemspecs closer to the path root" do @@ -139,7 +139,7 @@ describe "bundle install with explicit source paths" do # Installation of the 'gemfiles' gemspec would fail since it will be unable # to require 'premailer.rb' - expect(the_bundle).to have_installed "premailer 1.0.0" + expect(the_bundle).to include_gems "premailer 1.0.0" end it "warns on invalid specs", :rubygems => "1.7" do @@ -179,8 +179,8 @@ describe "bundle install with explicit source paths" do Dir.chdir(lib_path("foo")) do bundle "install" - expect(the_bundle).to have_installed "foo 1.0" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "foo 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -194,8 +194,8 @@ describe "bundle install with explicit source paths" do gemspec :path => "#{lib_path("foo")}" G - expect(the_bundle).to have_installed "foo 1.0" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "foo 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "doesn't automatically unlock dependencies when using the gemspec syntax" do @@ -214,8 +214,8 @@ describe "bundle install with explicit source paths" do bundle "install" - expect(the_bundle).to have_installed "foo 1.0" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "foo 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "doesn't automatically unlock dependencies when using the gemspec syntax and the gem has development dependencies" do @@ -235,8 +235,8 @@ describe "bundle install with explicit source paths" do bundle "install" - expect(the_bundle).to have_installed "foo 1.0" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "foo 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "raises if there are multiple gemspecs" do @@ -261,7 +261,7 @@ describe "bundle install with explicit source paths" do gemspec :path => "#{lib_path("foo")}", :name => "foo" G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "sets up executables" do @@ -273,7 +273,7 @@ describe "bundle install with explicit source paths" do path "#{lib_path("foo-1.0")}" gem 'foo' G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" bundle "exec foobar" expect(out).to eq("1.0") @@ -312,7 +312,7 @@ describe "bundle install with explicit source paths" do end G - expect(the_bundle).to have_installed "omg 1.0", "hi2u 1.0" + expect(the_bundle).to include_gems "omg 1.0", "hi2u 1.0" end end @@ -328,7 +328,7 @@ describe "bundle install with explicit source paths" do gem "omg", :path => "#{lib_path("omg")}" G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "works when the path does not have a gemspec" do @@ -338,9 +338,9 @@ describe "bundle install with explicit source paths" do gem "foo", "1.0", :path => "#{lib_path("foo-1.0")}" G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "works when the path does not have a gemspec but there is a lockfile" do @@ -371,7 +371,7 @@ describe "bundle install with explicit source paths" do bundle :check, :env => { "DEBUG" => 1 } expect(out).to match(/using resolution from the lockfile/) - expect(the_bundle).to have_installed "rack-obama 1.0", "net-ssh 1.0" + expect(the_bundle).to include_gems "rack-obama 1.0", "net-ssh 1.0" end it "source path gems w/deps don't re-resolve without changes" do @@ -391,7 +391,7 @@ describe "bundle install with explicit source paths" do bundle :check, :env => { "DEBUG" => 1 } expect(out).to match(/using resolution from the lockfile/) - expect(the_bundle).to have_installed "rack-obama 1.0", "net-ssh 1.0" + expect(the_bundle).to include_gems "rack-obama 1.0", "net-ssh 1.0" end end @@ -427,7 +427,7 @@ describe "bundle install with explicit source paths" do bundle "install" - expect(the_bundle).to have_installed "foo 2.0", "bar 1.0" + expect(the_bundle).to include_gems "foo 2.0", "bar 1.0" end it "unlocks all gems when a child dependency gem is updated" do @@ -435,7 +435,7 @@ describe "bundle install with explicit source paths" do bundle "install" - expect(the_bundle).to have_installed "foo 1.0", "bar 2.0" + expect(the_bundle).to include_gems "foo 1.0", "bar 2.0" end end @@ -456,7 +456,7 @@ describe "bundle install with explicit source paths" do bundle "install" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -480,7 +480,7 @@ describe "bundle install with explicit source paths" do gem "bar", :path => "#{lib_path("bar")}" G - expect(the_bundle).to have_installed "foo 1.0", "bar 1.0" + expect(the_bundle).to include_gems "foo 1.0", "bar 1.0" end it "switches the source when the gem existed in rubygems and the path was already being used for another gem" do @@ -507,7 +507,7 @@ describe "bundle install with explicit source paths" do end G - expect(the_bundle).to have_installed "bar 1.0" + expect(the_bundle).to include_gems "bar 1.0" end end @@ -525,8 +525,8 @@ describe "bundle install with explicit source paths" do bundle :install, :env => { "DEBUG" => 1 }, :artifice => "endpoint" expect(out).to match(%r{^HTTP GET http://localgemserver\.test/api/v1/dependencies\?gems=rack$}) expect(out).not_to match(/^HTTP GET.*private_lib/) - expect(the_bundle).to have_installed "private_lib 2.2" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "private_lib 2.2" + expect(the_bundle).to include_gems "rack 1.0" end end end diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb index bd8e7ac2da..58129bb313 100644 --- a/spec/install/gemfile/platform_spec.rb +++ b/spec/install/gemfile/platform_spec.rb @@ -22,7 +22,7 @@ describe "bundle install across platforms" do gem "rack" G - expect(the_bundle).to have_installed "rack 0.9.1" + expect(the_bundle).to include_gems "rack 0.9.1" end it "pulls in the correct platform specific gem" do @@ -48,7 +48,7 @@ describe "bundle install across platforms" do gem "platform_specific" G - expect(the_bundle).to have_installed "platform_specific 1.0 JAVA" + expect(the_bundle).to include_gems "platform_specific 1.0 JAVA" end it "works with gems that have different dependencies" do @@ -59,7 +59,7 @@ describe "bundle install across platforms" do gem "nokogiri" G - expect(the_bundle).to have_installed "nokogiri 1.4.2 JAVA", "weakling 0.0.3" + expect(the_bundle).to include_gems "nokogiri 1.4.2 JAVA", "weakling 0.0.3" simulate_new_machine @@ -70,8 +70,8 @@ describe "bundle install across platforms" do gem "nokogiri" G - expect(the_bundle).to have_installed "nokogiri 1.4.2" - expect(the_bundle).not_to have_installed "weakling" + expect(the_bundle).to include_gems "nokogiri 1.4.2" + expect(the_bundle).not_to include_gems "weakling" end it "works the other way with gems that have different dependencies" do @@ -85,7 +85,7 @@ describe "bundle install across platforms" do simulate_platform "java" bundle "install" - expect(the_bundle).to have_installed "nokogiri 1.4.2 JAVA", "weakling 0.0.3" + expect(the_bundle).to include_gems "nokogiri 1.4.2 JAVA", "weakling 0.0.3" end it "fetches gems again after changing the version of Ruby" do @@ -115,7 +115,7 @@ describe "bundle install with platform conditionals" do end G - expect(the_bundle).to have_installed "nokogiri 1.4.2" + expect(the_bundle).to include_gems "nokogiri 1.4.2" end it "does not install gems tagged w/ another platforms" do @@ -127,8 +127,8 @@ describe "bundle install with platform conditionals" do end G - expect(the_bundle).to have_installed "rack 1.0" - expect(the_bundle).not_to have_installed "nokogiri 1.4.2" + expect(the_bundle).to include_gems "rack 1.0" + expect(the_bundle).not_to include_gems "nokogiri 1.4.2" end it "installs gems tagged w/ the current platforms inline" do @@ -136,7 +136,7 @@ describe "bundle install with platform conditionals" do source "file://#{gem_repo1}" gem "nokogiri", :platforms => :#{local_tag} G - expect(the_bundle).to have_installed "nokogiri 1.4.2" + expect(the_bundle).to include_gems "nokogiri 1.4.2" end it "does not install gems tagged w/ another platforms inline" do @@ -145,8 +145,8 @@ describe "bundle install with platform conditionals" do gem "rack" gem "nokogiri", :platforms => :#{not_local_tag} G - expect(the_bundle).to have_installed "rack 1.0" - expect(the_bundle).not_to have_installed "nokogiri 1.4.2" + expect(the_bundle).to include_gems "rack 1.0" + expect(the_bundle).not_to include_gems "nokogiri 1.4.2" end it "installs gems tagged w/ the current platform inline" do @@ -154,7 +154,7 @@ describe "bundle install with platform conditionals" do source "file://#{gem_repo1}" gem "nokogiri", :platform => :#{local_tag} G - expect(the_bundle).to have_installed "nokogiri 1.4.2" + expect(the_bundle).to include_gems "nokogiri 1.4.2" end it "doesn't install gems tagged w/ another platform inline" do @@ -162,7 +162,7 @@ describe "bundle install with platform conditionals" do source "file://#{gem_repo1}" gem "nokogiri", :platform => :#{not_local_tag} G - expect(the_bundle).not_to have_installed "nokogiri 1.4.2" + expect(the_bundle).not_to include_gems "nokogiri 1.4.2" end it "does not blow up on sources with all platform-excluded specs" do @@ -217,6 +217,6 @@ describe "when a gem has no architecture" do G bundle :install, :fakeweb => "windows" - expect(the_bundle).to have_installed "rcov 1.0.0" + expect(the_bundle).to include_gems "rcov 1.0.0" end end diff --git a/spec/install/gemfile/ruby_spec.rb b/spec/install/gemfile/ruby_spec.rb index d4dad64622..1adbf10833 100644 --- a/spec/install/gemfile/ruby_spec.rb +++ b/spec/install/gemfile/ruby_spec.rb @@ -24,7 +24,7 @@ describe "ruby requirement" do G expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed "rack-obama 1.0" + expect(the_bundle).to include_gems "rack-obama 1.0" end it "allows removing the ruby version requirement" do @@ -41,7 +41,7 @@ describe "ruby requirement" do gem "rack" G - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(lockfile).not_to include("RUBY VERSION") end @@ -62,7 +62,7 @@ describe "ruby requirement" do gem "rack" G - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(locked_ruby_version).to eq(Bundler::RubyVersion.system) end @@ -83,7 +83,7 @@ describe "ruby requirement" do gem "rack" G - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(locked_ruby_version.versions).to eq(["5100"]) end end diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb index c6f389a70d..fd11c3feab 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -35,7 +35,7 @@ describe "bundle install with gems on multiple sources" do expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.") expect(out).to include("Warning: the gem 'rack' was found in multiple sources.") expect(out).to include("Installed from: file:#{gem_repo1}") - expect(the_bundle).to have_installed("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1") + expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1") end it "errors when disable_multisource is set" do @@ -65,7 +65,7 @@ describe "bundle install with gems on multiple sources" do expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.") expect(out).to include("Warning: the gem 'rack' was found in multiple sources.") expect(out).to include("Installed from: file:#{gem_repo1}") - expect(the_bundle).to have_installed("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1") + expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1") end end end @@ -94,8 +94,8 @@ describe "bundle install with gems on multiple sources" do it "installs the gems without any warning" do bundle :install expect(out).not_to include("Warning") - expect(the_bundle).to have_installed("rack-obama 1.0.0") - expect(the_bundle).to have_installed("rack 1.0.0", :source => "remote1") + expect(the_bundle).to include_gems("rack-obama 1.0.0") + expect(the_bundle).to include_gems("rack 1.0.0", :source => "remote1") end it "can cache and deploy" do @@ -107,7 +107,7 @@ describe "bundle install with gems on multiple sources" do bundle "install --deployment" expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed("rack-obama 1.0.0", "rack 1.0.0") + expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0") end end @@ -131,7 +131,7 @@ describe "bundle install with gems on multiple sources" do it "installs the gems without any warning" do bundle :install expect(out).not_to include("Warning") - expect(the_bundle).to have_installed("rack-obama 1.0.0", "rack 1.0.0") + expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0") end end @@ -167,7 +167,7 @@ describe "bundle install with gems on multiple sources" do it "installs from the same source without any warning" do bundle :install expect(out).not_to include("Warning") - expect(the_bundle).to have_installed("depends_on_rack 1.0.1", "rack 1.0.0") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") end end @@ -184,7 +184,7 @@ describe "bundle install with gems on multiple sources" do it "installs from the same source without any warning" do bundle :install expect(out).not_to include("Warning") - expect(the_bundle).to have_installed("depends_on_rack 1.0.1", "rack 1.0.0") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") end end end @@ -210,7 +210,7 @@ describe "bundle install with gems on multiple sources" do it "installs from the other source without any warning" do bundle :install expect(out).not_to include("Warning") - expect(the_bundle).to have_installed("depends_on_rack 1.0.1", "rack 1.0.0") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") end end @@ -231,7 +231,7 @@ describe "bundle install with gems on multiple sources" do expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.") expect(out).to include("Warning: the gem 'rack' was found in multiple sources.") expect(out).to include("Installed from: file:#{gem_repo2}") - expect(the_bundle).to have_installed("depends_on_rack 1.0.1", "rack 1.0.0") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") end end @@ -257,7 +257,7 @@ describe "bundle install with gems on multiple sources" do bundle :install expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.") - expect(the_bundle).to have_installed("depends_on_rack 1.0.1", "rack 1.0.0") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") # In https://github.com/bundler/bundler/issues/3585 this failed # when there is already a lock file, and the gems are missing, so try again @@ -265,7 +265,7 @@ describe "bundle install with gems on multiple sources" do bundle :install expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.") - expect(the_bundle).to have_installed("depends_on_rack 1.0.1", "rack 1.0.0") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") end end end @@ -317,7 +317,7 @@ describe "bundle install with gems on multiple sources" do # Reproduction of https://github.com/bundler/bundler/issues/3298 it "does not unlock the installed gem on exec" do - expect(the_bundle).to have_installed("rack 0.9.1") + expect(the_bundle).to include_gems("rack 0.9.1") end end @@ -355,7 +355,7 @@ describe "bundle install with gems on multiple sources" do it "installs the gems without any warning" do bundle :install expect(out).not_to include("Warning") - expect(the_bundle).to have_installed("rack 1.0.0") + expect(the_bundle).to include_gems("rack 1.0.0") end end @@ -413,8 +413,8 @@ describe "bundle install with gems on multiple sources" do G # 6. Which should update foo to 0.2, but not the (locked) bar 0.1 - expect(the_bundle).to have_installed("foo 0.2") - expect(the_bundle).to have_installed("bar 0.1") + expect(the_bundle).to include_gems("foo 0.2") + expect(the_bundle).to include_gems("bar 0.1") end end diff --git a/spec/install/gemfile_spec.rb b/spec/install/gemfile_spec.rb index 3bc1c50efc..98abc30c86 100644 --- a/spec/install/gemfile_spec.rb +++ b/spec/install/gemfile_spec.rb @@ -22,7 +22,7 @@ describe "bundle install" do bundle :install, :gemfile => bundled_app("NotGemfile") ENV["BUNDLE_GEMFILE"] = "NotGemfile" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb index e78eda459e..05137c9ffe 100644 --- a/spec/install/gems/compact_index_spec.rb +++ b/spec/install/gems/compact_index_spec.rb @@ -13,7 +13,7 @@ describe "compact index api" do bundle! :install, :artifice => "compact_index" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "should URI encode gem names" do @@ -34,7 +34,7 @@ describe "compact index api" do bundle! :install, :artifice => "compact_index" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed( + expect(the_bundle).to include_gems( "rails 2.3.2", "actionpack 2.3.2", "activerecord 2.3.2", @@ -51,7 +51,7 @@ describe "compact index api" do G bundle! :install, :artifice => "compact_index" - expect(the_bundle).to have_installed "net-sftp 1.1.1" + expect(the_bundle).to include_gems "net-sftp 1.1.1" end it "should use the endpoint when using --deployment" do @@ -63,7 +63,7 @@ describe "compact index api" do bundle "install --deployment", :artifice => "compact_index" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "handles git dependencies that are in rubygems" do @@ -81,7 +81,7 @@ describe "compact index api" do bundle! :install, :artifice => "compact_index" - expect(the_bundle).to have_installed("rails 2.3.2") + expect(the_bundle).to include_gems("rails 2.3.2") end it "handles git dependencies that are in rubygems using --deployment" do @@ -99,7 +99,7 @@ describe "compact index api" do bundle "install --deployment", :artifice => "compact_index" - expect(the_bundle).to have_installed("rails 2.3.2") + expect(the_bundle).to include_gems("rails 2.3.2") end it "doesn't fail if you only have a git gem with no deps when using --deployment" do @@ -113,7 +113,7 @@ describe "compact index api" do bundle "install --deployment", :artifice => "compact_index" expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") end it "falls back when the API errors out" do @@ -126,7 +126,7 @@ describe "compact index api" do bundle! :install, :fakeweb => "windows" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed "rcov 1.0.0" + expect(the_bundle).to include_gems "rcov 1.0.0" end it "falls back when the API URL returns 403 Forbidden" do @@ -137,7 +137,7 @@ describe "compact index api" do bundle! :install, :verbose => true, :artifice => "compact_index_forbidden" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "falls back when the versions endpoint has a checksum mismatch" do @@ -151,7 +151,7 @@ describe "compact index api" do expect(out).to include <<-'WARN' The checksum of /versions does not match the checksum provided by the server! Something is wrong (local checksum is "\"d41d8cd98f00b204e9800998ecf8427e\"", was expecting "\"123\""). WARN - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "falls back when the user's home directory does not exist or is not writable" do @@ -164,7 +164,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "handles host redirects" do @@ -174,7 +174,7 @@ The checksum of /versions does not match the checksum provided by the server! So G bundle! :install, :artifice => "compact_index_host_redirect" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "handles host redirects without Net::HTTP::Persistent" do @@ -198,7 +198,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_host_redirect", :requires => [lib_path("disable_net_http_persistent.rb")] expect(out).to_not match(/Too many redirects/) - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "times out when Bundler::Fetcher redirects too much" do @@ -220,7 +220,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle "install --full-index", :artifice => "compact_index" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "should use the modern index for update" do @@ -231,7 +231,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle "update --full-index", :artifice => "compact_index" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -250,7 +250,7 @@ The checksum of /versions does not match the checksum provided by the server! So G bundle! :install, :artifice => "compact_index_extra" - expect(the_bundle).to have_installed "back_deps 1.0" + expect(the_bundle).to include_gems "back_deps 1.0" end it "fetches gem versions even when those gems are already installed" do @@ -259,7 +259,7 @@ The checksum of /versions does not match the checksum provided by the server! So gem "rack", "1.0.0" G bundle! :install, :artifice => "compact_index_extra_api" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" build_repo4 do build_gem "rack", "1.2" do |s| @@ -273,7 +273,7 @@ The checksum of /versions does not match the checksum provided by the server! So gem "rack", "1.2" G bundle! :install, :artifice => "compact_index_extra_api" - expect(the_bundle).to have_installed "rack 1.2" + expect(the_bundle).to include_gems "rack 1.2" end it "considers all possible versions of dependencies from all api gem sources" do @@ -296,8 +296,8 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_extra_api" - expect(the_bundle).to have_installed "somegem 1.0.0" - expect(the_bundle).to have_installed "activesupport 1.2.3" + expect(the_bundle).to include_gems "somegem 1.0.0" + expect(the_bundle).to include_gems "activesupport 1.2.3" end it "prints API output properly with back deps" do @@ -341,7 +341,7 @@ The checksum of /versions does not match the checksum provided by the server! So G bundle! :install, :artifice => "compact_index_extra_missing" - expect(the_bundle).to have_installed "back_deps 1.0" + expect(the_bundle).to include_gems "back_deps 1.0" end it "uses the endpoint if all sources support it" do @@ -352,7 +352,7 @@ The checksum of /versions does not match the checksum provided by the server! So G bundle! :install, :artifice => "compact_index_api_missing" - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "fetches again when more dependencies are found in subsequent sources using --deployment" do @@ -372,7 +372,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_extra" bundle "install --deployment", :artifice => "compact_index_extra" - expect(the_bundle).to have_installed "back_deps 1.0" + expect(the_bundle).to include_gems "back_deps 1.0" end it "does not refetch if the only unmet dependency is bundler" do @@ -395,7 +395,7 @@ The checksum of /versions does not match the checksum provided by the server! So gem "rails" G bundle! :install, :artifice => "compact_index" - expect(the_bundle).to have_installed "rails 2.3.2" + expect(the_bundle).to include_gems "rails 2.3.2" end it "installs the binstubs" do @@ -472,7 +472,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_basic_authentication" expect(out).not_to include("#{user}:#{password}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "strips http basic authentication creds for modern index" do @@ -483,7 +483,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "endopint_marshal_fail_basic_authentication" expect(out).not_to include("#{user}:#{password}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "strips http basic auth creds when it can't reach the server" do @@ -506,7 +506,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_basic_authentication" expect(out).to include("Warning: the gem 'rack' was found in multiple sources.") expect(out).not_to include("#{user}:#{password}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "does not pass the user / password to different hosts on redirect" do @@ -516,7 +516,7 @@ The checksum of /versions does not match the checksum provided by the server! So G bundle! :install, :artifice => "compact_index_creds_diff_host" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end describe "with authentication details in bundle config" do @@ -533,7 +533,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_strict_basic_authentication" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "reads authentication details by full url from bundle config" do @@ -543,14 +543,14 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_strict_basic_authentication" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "should use the API" do bundle "config #{source_hostname} #{user}:#{password}" bundle! :install, :artifice => "compact_index_strict_basic_authentication" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "prefers auth supplied in the source uri" do @@ -562,7 +562,7 @@ The checksum of /versions does not match the checksum provided by the server! So bundle "config #{source_hostname} otheruser:wrong" bundle! :install, :artifice => "compact_index_strict_basic_authentication" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "shows instructions if auth is not provided for the source" do @@ -588,7 +588,7 @@ The checksum of /versions does not match the checksum provided by the server! So G bundle! :install, :artifice => "compact_index_basic_authentication" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end @@ -673,6 +673,6 @@ The checksum of /versions does not match the checksum provided by the server! So bundle! :install, :artifice => "compact_index_concurrent_download" expect(File.read(versions)).to start_with("created_at") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index 72e7bffcbc..a7c1aedea3 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -13,7 +13,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "should URI encode gem names" do @@ -34,7 +34,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint" expect(out).to include("Fetching gem metadata from #{source_uri}/...") - expect(the_bundle).to have_installed( + expect(the_bundle).to include_gems( "rails 2.3.2", "actionpack 2.3.2", "activerecord 2.3.2", @@ -51,7 +51,7 @@ describe "gemcutter's dependency API" do G bundle :install, :artifice => "endpoint" - expect(the_bundle).to have_installed "net-sftp 1.1.1" + expect(the_bundle).to include_gems "net-sftp 1.1.1" end it "should use the endpoint when using --deployment" do @@ -63,7 +63,7 @@ describe "gemcutter's dependency API" do bundle "install --deployment", :artifice => "endpoint" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "handles git dependencies that are in rubygems" do @@ -81,7 +81,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint" - expect(the_bundle).to have_installed("rails 2.3.2") + expect(the_bundle).to include_gems("rails 2.3.2") end it "handles git dependencies that are in rubygems using --deployment" do @@ -99,7 +99,7 @@ describe "gemcutter's dependency API" do bundle "install --deployment", :artifice => "endpoint" - expect(the_bundle).to have_installed("rails 2.3.2") + expect(the_bundle).to include_gems("rails 2.3.2") end it "doesn't fail if you only have a git gem with no deps when using --deployment" do @@ -113,7 +113,7 @@ describe "gemcutter's dependency API" do bundle "install --deployment", :artifice => "endpoint" expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed("foo 1.0") + expect(the_bundle).to include_gems("foo 1.0") end it "falls back when the API errors out" do @@ -126,7 +126,7 @@ describe "gemcutter's dependency API" do bundle :install, :fakeweb => "windows" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed "rcov 1.0.0" + expect(the_bundle).to include_gems "rcov 1.0.0" end it "falls back when hitting the Gemcutter Dependency Limit" do @@ -143,7 +143,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_fallback" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed( + expect(the_bundle).to include_gems( "activesupport 2.3.2", "actionpack 2.3.2", "actionmailer 2.3.2", @@ -163,7 +163,7 @@ describe "gemcutter's dependency API" do bundle :install, :verbose => true, :artifice => "endpoint_marshal_fail" expect(out).to include("could not fetch from the dependency API, trying the full index") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "falls back when the API URL returns 403 Forbidden" do @@ -174,7 +174,7 @@ describe "gemcutter's dependency API" do bundle :install, :verbose => true, :artifice => "endpoint_api_forbidden" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "handles host redirects" do @@ -184,7 +184,7 @@ describe "gemcutter's dependency API" do G bundle :install, :artifice => "endpoint_host_redirect" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "handles host redirects without Net::HTTP::Persistent" do @@ -208,7 +208,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_host_redirect", :requires => [lib_path("disable_net_http_persistent.rb")] expect(out).to_not match(/Too many redirects/) - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "timeouts when Bundler::Fetcher redirects too much" do @@ -230,7 +230,7 @@ describe "gemcutter's dependency API" do bundle "install --full-index", :artifice => "endpoint" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "should use the modern index for update" do @@ -241,7 +241,7 @@ describe "gemcutter's dependency API" do bundle "update --full-index", :artifice => "endpoint" expect(out).to include("Fetching source index from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -260,7 +260,7 @@ describe "gemcutter's dependency API" do G bundle :install, :artifice => "endpoint_extra" - expect(the_bundle).to have_installed "back_deps 1.0" + expect(the_bundle).to include_gems "back_deps 1.0" end it "fetches gem versions even when those gems are already installed" do @@ -282,7 +282,7 @@ describe "gemcutter's dependency API" do gem "rack", "1.2" G bundle :install, :artifice => "endpoint_extra_api" - expect(the_bundle).to have_installed "rack 1.2" + expect(the_bundle).to include_gems "rack 1.2" end it "considers all possible versions of dependencies from all api gem sources" do @@ -305,8 +305,8 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_extra_api" - expect(the_bundle).to have_installed "somegem 1.0.0" - expect(the_bundle).to have_installed "activesupport 1.2.3" + expect(the_bundle).to include_gems "somegem 1.0.0" + expect(the_bundle).to include_gems "activesupport 1.2.3" end it "prints API output properly with back deps" do @@ -350,7 +350,7 @@ describe "gemcutter's dependency API" do G bundle :install, :artifice => "endpoint_extra_missing" - expect(the_bundle).to have_installed "back_deps 1.0" + expect(the_bundle).to include_gems "back_deps 1.0" end it "uses the endpoint if all sources support it" do @@ -361,7 +361,7 @@ describe "gemcutter's dependency API" do G bundle :install, :artifice => "endpoint_api_missing" - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "fetches again when more dependencies are found in subsequent sources using --deployment" do @@ -381,7 +381,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_extra" bundle "install --deployment", :artifice => "endpoint_extra" - expect(the_bundle).to have_installed "back_deps 1.0" + expect(the_bundle).to include_gems "back_deps 1.0" end it "does not refetch if the only unmet dependency is bundler" do @@ -404,7 +404,7 @@ describe "gemcutter's dependency API" do gem "rails" G bundle :install, :artifice => "endpoint" - expect(the_bundle).to have_installed "rails 2.3.2" + expect(the_bundle).to include_gems "rails 2.3.2" end it "installs the binstubs" do @@ -481,7 +481,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_basic_authentication" expect(out).not_to include("#{user}:#{password}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "strips http basic authentication creds for modern index" do @@ -492,7 +492,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endopint_marshal_fail_basic_authentication" expect(out).not_to include("#{user}:#{password}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "strips http basic auth creds when it can't reach the server" do @@ -515,7 +515,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_basic_authentication" expect(out).to include("Warning: the gem 'rack' was found in multiple sources.") expect(out).not_to include("#{user}:#{password}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "does not pass the user / password to different hosts on redirect" do @@ -525,7 +525,7 @@ describe "gemcutter's dependency API" do G bundle :install, :artifice => "endpoint_creds_diff_host" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end describe "with authentication details in bundle config" do @@ -542,7 +542,7 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_strict_basic_authentication" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "reads authentication details by full url from bundle config" do @@ -552,14 +552,14 @@ describe "gemcutter's dependency API" do bundle :install, :artifice => "endpoint_strict_basic_authentication" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "should use the API" do bundle "config #{source_hostname} #{user}:#{password}" bundle :install, :artifice => "endpoint_strict_basic_authentication" expect(out).to include("Fetching gem metadata from #{source_uri}") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "prefers auth supplied in the source uri" do @@ -571,7 +571,7 @@ describe "gemcutter's dependency API" do bundle "config #{source_hostname} otheruser:wrong" bundle :install, :artifice => "endpoint_strict_basic_authentication" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "shows instructions if auth is not provided for the source" do @@ -597,7 +597,7 @@ describe "gemcutter's dependency API" do G bundle :install, :artifice => "endpoint_basic_authentication" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end diff --git a/spec/install/gems/env_spec.rb b/spec/install/gems/env_spec.rb index 3168dc795b..d7d3a3230e 100644 --- a/spec/install/gems/env_spec.rb +++ b/spec/install/gems/env_spec.rb @@ -15,13 +15,13 @@ describe "bundle install with ENV conditionals" do it "excludes the gems when the ENV variable is not set" do bundle :install - expect(the_bundle).not_to have_installed "rack" + expect(the_bundle).not_to include_gems "rack" end it "includes the gems when the ENV variable is set" do ENV["BUNDLER_TEST"] = "1" bundle :install - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -38,13 +38,13 @@ describe "bundle install with ENV conditionals" do it "excludes the gems when the ENV variable is not set" do bundle :install - expect(the_bundle).not_to have_installed "rack" + expect(the_bundle).not_to include_gems "rack" end it "includes the gems when the ENV variable is set" do ENV["BUNDLER_TEST"] = "1" bundle :install - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -61,19 +61,19 @@ describe "bundle install with ENV conditionals" do it "excludes the gems when the ENV variable is not set" do bundle :install - expect(the_bundle).not_to have_installed "rack" + expect(the_bundle).not_to include_gems "rack" end it "excludes the gems when the ENV variable is set but does not match the condition" do ENV["BUNDLER_TEST"] = "1" bundle :install - expect(the_bundle).not_to have_installed "rack" + expect(the_bundle).not_to include_gems "rack" end it "includes the gems when the ENV variable is set and matches the condition" do ENV["BUNDLER_TEST"] = "foo" bundle :install - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -90,19 +90,19 @@ describe "bundle install with ENV conditionals" do it "excludes the gems when the ENV variable is not set" do bundle :install - expect(the_bundle).not_to have_installed "rack" + expect(the_bundle).not_to include_gems "rack" end it "excludes the gems when the ENV variable is set but does not match the condition" do ENV["BUNDLER_TEST"] = "fo" bundle :install - expect(the_bundle).not_to have_installed "rack" + expect(the_bundle).not_to include_gems "rack" end it "includes the gems when the ENV variable is set and matches the condition" do ENV["BUNDLER_TEST"] = "foobar" bundle :install - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end end diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb index 232b3ced5a..cb4ae9d54f 100644 --- a/spec/install/gems/flex_spec.rb +++ b/spec/install/gems/flex_spec.rb @@ -8,7 +8,7 @@ describe "bundle flex_install" do gem 'rack' G - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(the_bundle).to be_locked end @@ -18,7 +18,7 @@ describe "bundle flex_install" do gem 'rack' G - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(the_bundle).to be_locked gemfile <<-G @@ -27,7 +27,7 @@ describe "bundle flex_install" do G bundle :install - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" expect(the_bundle).to be_locked end @@ -39,7 +39,7 @@ describe "bundle flex_install" do gem "rack-obama" G - expect(the_bundle).to have_installed "rack 1.0.0", "rack-obama 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0", "rack-obama 1.0.0" update_repo2 install_gemfile <<-G @@ -47,7 +47,7 @@ describe "bundle flex_install" do gem "rack-obama", "1.0" G - expect(the_bundle).to have_installed "rack 1.0.0", "rack-obama 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0", "rack-obama 1.0.0" end describe "adding new gems" do @@ -67,7 +67,7 @@ describe "bundle flex_install" do gem 'activesupport', '2.3.5' G - expect(the_bundle).to have_installed "rack 1.0.0", "activesupport 2.3.5" + expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5" end it "keeps child dependencies pinned" do @@ -86,7 +86,7 @@ describe "bundle flex_install" do gem "thin" G - expect(the_bundle).to have_installed "rack 1.0.0", "rack-obama 1.0", "thin 1.0" + expect(the_bundle).to include_gems "rack 1.0.0", "rack-obama 1.0", "thin 1.0" end end @@ -106,8 +106,8 @@ describe "bundle flex_install" do gem 'rack' G - expect(the_bundle).to have_installed "rack 1.0.0" - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "rack 1.0.0" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" install_gemfile <<-G source "file://#{gem_repo2}" @@ -115,7 +115,7 @@ describe "bundle flex_install" do gem 'activesupport', '2.3.2' G - expect(the_bundle).to have_installed "rack 1.0.0", "activesupport 2.3.2" + expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.2" end it "removes top level dependencies when removed from the Gemfile while leaving other dependencies intact" do @@ -133,7 +133,7 @@ describe "bundle flex_install" do gem 'rack' G - expect(the_bundle).not_to have_installed "activesupport 2.3.5" + expect(the_bundle).not_to include_gems "activesupport 2.3.5" end it "removes child dependencies" do @@ -144,7 +144,7 @@ describe "bundle flex_install" do gem 'activesupport' G - expect(the_bundle).to have_installed "rack 1.0.0", "rack-obama 1.0.0", "activesupport 2.3.5" + expect(the_bundle).to include_gems "rack 1.0.0", "rack-obama 1.0.0", "activesupport 2.3.5" update_repo2 install_gemfile <<-G @@ -152,8 +152,8 @@ describe "bundle flex_install" do gem 'activesupport' G - expect(the_bundle).to have_installed "activesupport 2.3.5" - expect(the_bundle).not_to have_installed "rack-obama", "rack" + expect(the_bundle).to include_gems "activesupport 2.3.5" + expect(the_bundle).not_to include_gems "rack-obama", "rack" end end @@ -165,7 +165,7 @@ describe "bundle flex_install" do gem "rack_middleware" G - expect(the_bundle).to have_installed "rack_middleware 1.0", "rack 0.9.1" + expect(the_bundle).to include_gems "rack_middleware 1.0", "rack 0.9.1" build_repo2 update_repo2 do diff --git a/spec/install/gems/mirror_spec.rb b/spec/install/gems/mirror_spec.rb index ba2e502099..e7b4317f05 100644 --- a/spec/install/gems/mirror_spec.rb +++ b/spec/install/gems/mirror_spec.rb @@ -15,7 +15,7 @@ describe "bundle install with a mirror configured" do it "installs from the normal location" do bundle :install expect(out).to include("Fetching source index from file:#{gem_repo1}") - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end @@ -34,7 +34,7 @@ describe "bundle install with a mirror configured" do bundle :install expect(out).to include("Fetching source index from file:#{gem_repo1}") expect(out).not_to include("Fetching source index from file:#{gem_repo2}") - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end end diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb index f18f4dbb63..46c118b165 100644 --- a/spec/install/gems/resolving_spec.rb +++ b/spec/install/gems/resolving_spec.rb @@ -36,7 +36,7 @@ describe "bundle install with install-time dependencies" do gem "actionpack", "2.3.2" G - expect(the_bundle).to have_installed "actionpack 2.3.2", "activesupport 2.3.2" + expect(the_bundle).to include_gems "actionpack 2.3.2", "activesupport 2.3.2" end describe "with crazy rubygem plugin stuff" do @@ -46,7 +46,7 @@ describe "bundle install with install-time dependencies" do gem "net_b" G - expect(the_bundle).to have_installed "net_b 1.0" + expect(the_bundle).to include_gems "net_b 1.0" end it "installs plugins depended on by other plugins" do @@ -55,7 +55,7 @@ describe "bundle install with install-time dependencies" do gem "net_a" G - expect(the_bundle).to have_installed "net_a 1.0", "net_b 1.0" + expect(the_bundle).to include_gems "net_a 1.0", "net_b 1.0" end it "installs multiple levels of dependencies" do @@ -65,7 +65,7 @@ describe "bundle install with install-time dependencies" do gem "net_e" G - expect(the_bundle).to have_installed "net_a 1.0", "net_b 1.0", "net_c 1.0", "net_d 1.0", "net_e 1.0" + expect(the_bundle).to include_gems "net_a 1.0", "net_b 1.0", "net_c 1.0", "net_d 1.0", "net_e 1.0" end context "with ENV['DEBUG_RESOLVER'] set" do @@ -118,7 +118,7 @@ describe "bundle install with install-time dependencies" do G expect(out).to_not include("rack-9001.0.0 requires ruby version > 9000") - expect(the_bundle).to have_installed("rack 1.2") + expect(the_bundle).to include_gems("rack 1.2") end end diff --git a/spec/install/gems/standalone_spec.rb b/spec/install/gems/standalone_spec.rb index 71e58305aa..44de0d8126 100644 --- a/spec/install/gems/standalone_spec.rb +++ b/spec/install/gems/standalone_spec.rb @@ -5,7 +5,7 @@ shared_examples "bundle install --standalone" do shared_examples "common functionality" do it "still makes the gems available to normal bundler" do args = expected_gems.map {|k, v| "#{k} #{v}" } - expect(the_bundle).to have_installed(*args) + expect(the_bundle).to include_gems(*args) end it "generates a bundle/bundler/setup.rb" do diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index decac037d4..66b9901831 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -18,7 +18,7 @@ describe "when using sudo", :sudo => true do expect(out).to_not match(/an error occurred/i) expect(system_gem_path("cache/rack-1.0.0.gem")).to exist - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end end @@ -37,7 +37,7 @@ describe "when using sudo", :sudo => true do expect(system_gem_path("gems/rack-1.0.0")).to exist expect(system_gem_path("gems/rack-1.0.0").stat.uid).to eq(0) - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "installs rake and a gem dependent on rake in the same session" do @@ -63,7 +63,7 @@ describe "when using sudo", :sudo => true do expect(bundle_path.join("gems/rack-1.0.0")).to exist expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0) - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "installs when BUNDLE_PATH does not exist" do @@ -80,7 +80,7 @@ describe "when using sudo", :sudo => true do expect(bundle_path.join("gems/rack-1.0.0")).to exist expect(bundle_path.join("gems/rack-1.0.0").stat.uid).to eq(0) - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "installs extensions/ compiled by Rubygems 2.2", :rubygems => "2.2" do @@ -107,7 +107,7 @@ describe "when using sudo", :sudo => true do G expect(default_bundle_path("gems/rack-1.0.0")).to exist - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end it "cleans up the tmpdirs generated" do @@ -139,7 +139,7 @@ describe "when using sudo", :sudo => true do bundle :install, :env => { "GEM_HOME" => gem_home.to_s, "GEM_PATH" => nil } expect(gem_home.join("bin/rackup")).to exist - expect(the_bundle).to have_installed "rack 1.0", :env => { "GEM_HOME" => gem_home.to_s, "GEM_PATH" => nil } + expect(the_bundle).to include_gems "rack 1.0", :env => { "GEM_HOME" => gem_home.to_s, "GEM_PATH" => nil } end end diff --git a/spec/install/gemspecs_spec.rb b/spec/install/gemspecs_spec.rb index d9d95ce06b..3e6021b7e2 100644 --- a/spec/install/gemspecs_spec.rb +++ b/spec/install/gemspecs_spec.rb @@ -44,7 +44,7 @@ describe "bundle install" do f.write spec.to_ruby end bundle :install, :artifice => "endpoint_marshal_fail" # force gemspec load - expect(the_bundle).to have_installed "activesupport 2.3.2" + expect(the_bundle).to include_gems "activesupport 2.3.2" end context "when ruby version is specified in gemspec and gemfile" do @@ -57,7 +57,7 @@ describe "bundle install" do ruby '#{RUBY_VERSION}', :engine_version => '#{RUBY_VERSION}', :engine => 'ruby' gemspec G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "installs when patch level is specified and the version still matches the current version", @@ -70,7 +70,7 @@ describe "bundle install" do ruby '#{RUBY_VERSION}', :engine_version => '#{RUBY_VERSION}', :engine => 'ruby', :patchlevel => '#{RUBY_PATCHLEVEL}' gemspec G - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end it "fails and complains about patchlevel on patchlevel mismatch", diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index 1cfab66961..f35a543509 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -12,7 +12,7 @@ describe "bundle install" do bundle :install expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master@#{revision_for(lib_path("foo"))[0..6]})") - expect(the_bundle).to have_installed "foo 1.0", :source => "git@#{lib_path("foo")}" + expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}" end it "should check out git repos that are missing but not being installed" do diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index 986bda81b1..3d84fffd58 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -16,7 +16,7 @@ describe "bundle install" do it "does not use available system gems with bundle --path vendor/bundle" do bundle "install --path vendor/bundle" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "handles paths with regex characters in them" do @@ -48,7 +48,7 @@ describe "bundle install" do bundle "install" expect(vendored_gems("gems/rack-1.0.0")).to be_directory - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -79,7 +79,7 @@ describe "bundle install" do expect(vendored_gems("gems/rack-1.0.0")).to be_directory expect(bundled_app("vendor2")).not_to be_directory - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "installs gems to BUNDLE_PATH with #{type}" do @@ -88,7 +88,7 @@ describe "bundle install" do bundle :install expect(bundled_app("vendor/gems/rack-1.0.0")).to be_directory - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "installs gems to BUNDLE_PATH relative to root when relative" do @@ -100,7 +100,7 @@ describe "bundle install" do end expect(bundled_app("vendor/gems/rack-1.0.0")).to be_directory - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -110,14 +110,14 @@ describe "bundle install" do bundle :install expect(vendored_gems("gems/rack-1.0.0")).to be_directory - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "sets BUNDLE_PATH as the first argument to bundle install" do bundle "install --path ./vendor/bundle" expect(vendored_gems("gems/rack-1.0.0")).to be_directory - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "disables system gems when passing a path to install" do @@ -126,7 +126,7 @@ describe "bundle install" do bundle "install --path ./vendor/bundle" expect(vendored_gems("gems/rack-1.0.0")).to be_directory - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end diff --git a/spec/install/prereleases_spec.rb b/spec/install/prereleases_spec.rb index 05756ff395..cbf99ca96f 100644 --- a/spec/install/prereleases_spec.rb +++ b/spec/install/prereleases_spec.rb @@ -8,7 +8,7 @@ describe "bundle install" do source "file://#{gem_repo1}" gem "not_released" G - expect(the_bundle).to have_installed "not_released 1.0.pre" + expect(the_bundle).to include_gems "not_released 1.0.pre" end it "uses regular releases if available" do @@ -16,7 +16,7 @@ describe "bundle install" do source "file://#{gem_repo1}" gem "has_prerelease" G - expect(the_bundle).to have_installed "has_prerelease 1.0" + expect(the_bundle).to include_gems "has_prerelease 1.0" end it "uses prereleases if requested" do @@ -24,7 +24,7 @@ describe "bundle install" do source "file://#{gem_repo1}" gem "has_prerelease", "1.1.pre" G - expect(the_bundle).to have_installed "has_prerelease 1.1.pre" + expect(the_bundle).to include_gems "has_prerelease 1.1.pre" end end @@ -36,7 +36,7 @@ describe "bundle install" do gem "rack" G - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end end diff --git a/spec/install/security_policy_spec.rb b/spec/install/security_policy_spec.rb index b886362c40..7e2c320b80 100644 --- a/spec/install/security_policy_spec.rb +++ b/spec/install/security_policy_spec.rb @@ -19,7 +19,7 @@ describe "policies with unsigned gems" do bundle "install --deployment" bundle :install expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed "rack 1.0", "signed_gem 1.0" + expect(the_bundle).to include_gems "rack 1.0", "signed_gem 1.0" end it "will fail when given invalid security policy" do @@ -66,12 +66,12 @@ describe "policies with signed gems and no CA" do it "will succeed with Low Security setting, low security accepts self signed gem" do bundle "install --trust-policy=LowSecurity" expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed "signed_gem 1.0" + expect(the_bundle).to include_gems "signed_gem 1.0" end it "will succeed with no policy" do bundle "install" expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to have_installed "signed_gem 1.0" + expect(the_bundle).to include_gems "signed_gem 1.0" end end diff --git a/spec/lock/git_spec.rb b/spec/lock/git_spec.rb index db88aed750..93473db052 100644 --- a/spec/lock/git_spec.rb +++ b/spec/lock/git_spec.rb @@ -11,7 +11,7 @@ describe "bundle lock with git gems" do end it "doesn't break right after running lock" do - expect(the_bundle).to have_installed "foo 1.0.0" + expect(the_bundle).to include_gems "foo 1.0.0" end it "locks a git source to the current ref" do diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb index 964fd5261d..37035eaaf9 100644 --- a/spec/lock/lockfile_spec.rb +++ b/spec/lock/lockfile_spec.rb @@ -413,7 +413,7 @@ describe "the lockfile format" do #{Bundler::VERSION} G - expect(the_bundle).to have_installed "net-sftp 1.1.1", "net-ssh 1.0.0" + expect(the_bundle).to include_gems "net-sftp 1.1.1", "net-ssh 1.0.0" end it "generates a simple lockfile for a single pinned source, gem with a version requirement" do @@ -480,7 +480,7 @@ describe "the lockfile format" do L bundle "install" - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "serializes global git sources" do @@ -1168,7 +1168,7 @@ describe "the lockfile format" do G bundle "install --path vendor" - expect(the_bundle).to have_installed "omg 1.0" + expect(the_bundle).to include_gems "omg 1.0" # Create a Gemfile.lock that has duplicate GIT sections lockfile <<-L @@ -1202,7 +1202,7 @@ describe "the lockfile format" do FileUtils.rm_rf(bundled_app("vendor")) bundle "install" - expect(the_bundle).to have_installed "omg 1.0" + expect(the_bundle).to include_gems "omg 1.0" # Confirm that duplicate specs do not appear expect(File.read(bundled_app("Gemfile.lock"))).to eq(strip_whitespace(<<-L)) @@ -1245,7 +1245,7 @@ describe "the lockfile format" do it "generates Gemfile.lock with \\n line endings" do expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n") - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end context "during updates" do @@ -1254,7 +1254,7 @@ describe "the lockfile format" do expect { bundle "update" }.to change { File.mtime(bundled_app("Gemfile.lock")) } expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n") - expect(the_bundle).to have_installed "rack 1.2" + expect(the_bundle).to include_gems "rack 1.2" end it "preserves Gemfile.lock \\n\\r line endings" do @@ -1265,7 +1265,7 @@ describe "the lockfile format" do expect { bundle "update" }.to change { File.mtime(bundled_app("Gemfile.lock")) } expect(File.read(bundled_app("Gemfile.lock"))).to match("\r\n") - expect(the_bundle).to have_installed "rack 1.2" + expect(the_bundle).to include_gems "rack 1.2" end end diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index 97ed8d4f1c..7aa0d0f8ea 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -494,7 +494,7 @@ G end bundle "update" - expect(the_bundle).to have_installed "rack 1.2", "rack-obama 1.0", "activesupport 3.0" + expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0" end it "updates fine with any engine" do @@ -511,7 +511,7 @@ G end bundle "update" - expect(the_bundle).to have_installed "rack 1.2", "rack-obama 1.0", "activesupport 3.0" + expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0" end end diff --git a/spec/plugins/install_spec.rb b/spec/plugins/install_spec.rb index 880984b0e4..c667ed0a68 100644 --- a/spec/plugins/install_spec.rb +++ b/spec/plugins/install_spec.rb @@ -127,7 +127,7 @@ describe "bundler plugin install" do expect(out).to include("Bundle complete!") - expect(the_bundle).to have_installed("rack 1.0.0") + expect(the_bundle).to include_gems("rack 1.0.0") plugin_should_be_installed("foo") end diff --git a/spec/plugins/source/example_spec.rb b/spec/plugins/source/example_spec.rb index 2cb6c12323..520e1b9db4 100644 --- a/spec/plugins/source/example_spec.rb +++ b/spec/plugins/source/example_spec.rb @@ -61,7 +61,7 @@ describe "real source plugins" do expect(out).to include("Bundle complete!") - expect(the_bundle).to have_installed("a-path-gem 1.0") + expect(the_bundle).to include_gems("a-path-gem 1.0") end it "writes to lock file" do @@ -124,7 +124,7 @@ describe "real source plugins" do expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}/.bundlecache")).to be_file FileUtils.rm_rf lib_path("a-path-gem-1.0") - expect(the_bundle).to have_installed("a-path-gem 1.0") + expect(the_bundle).to include_gems("a-path-gem 1.0") end it "copies repository to vendor cache and uses it even when installed with bundle --path" do @@ -134,7 +134,7 @@ describe "real source plugins" do expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist FileUtils.rm_rf lib_path("a-path-gem-1.0") - expect(the_bundle).to have_installed("a-path-gem 1.0") + expect(the_bundle).to include_gems("a-path-gem 1.0") end it "bundler package copies repository to vendor cache" do @@ -144,7 +144,7 @@ describe "real source plugins" do expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist FileUtils.rm_rf lib_path("a-path-gem-1.0") - expect(the_bundle).to have_installed("a-path-gem 1.0") + expect(the_bundle).to include_gems("a-path-gem 1.0") end end @@ -175,7 +175,7 @@ describe "real source plugins" do it "installs" do bundle "install" - expect(the_bundle).to have_installed("a-path-gem 1.0") + expect(the_bundle).to include_gems("a-path-gem 1.0") end end end @@ -324,7 +324,7 @@ describe "real source plugins" do it "handles the source option" do bundle "install" expect(out).to include("Bundle complete!") - expect(the_bundle).to have_installed("ma-gitp-gem 1.0") + expect(the_bundle).to include_gems("ma-gitp-gem 1.0") end it "writes to lock file" do @@ -382,7 +382,7 @@ describe "real source plugins" do it "installs" do bundle "install" - expect(the_bundle).to have_installed("ma-gitp-gem 1.0") + expect(the_bundle).to include_gems("ma-gitp-gem 1.0") end it "uses the locked ref" do @@ -417,7 +417,7 @@ describe "real source plugins" do G bundle "install" - expect(the_bundle).to have_installed("ma-gitp-gem 1.1") + expect(the_bundle).to include_gems("ma-gitp-gem 1.1") end end @@ -439,7 +439,7 @@ describe "real source plugins" do expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file FileUtils.rm_rf lib_path("foo-1.0") - expect(the_bundle).to have_installed "foo 1.0" + expect(the_bundle).to include_gems "foo 1.0" end end end diff --git a/spec/realworld/dependency_api_spec.rb b/spec/realworld/dependency_api_spec.rb index f59fae43b7..bbb6f4a150 100644 --- a/spec/realworld/dependency_api_spec.rb +++ b/spec/realworld/dependency_api_spec.rb @@ -41,7 +41,7 @@ describe "gemcutter's dependency API", :realworld => true do bundle :install expect(out).to include("Fetching source index from #{@server_uri}/") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end diff --git a/spec/realworld/gemfile_source_header_spec.rb b/spec/realworld/gemfile_source_header_spec.rb index e202186172..38d419a246 100644 --- a/spec/realworld/gemfile_source_header_spec.rb +++ b/spec/realworld/gemfile_source_header_spec.rb @@ -26,7 +26,7 @@ describe "fetching dependencies with a mirrored source", :realworld => true, :ru expect(out).to include("Installing weakling") expect(out).to include("Bundle complete") - expect(the_bundle).to have_installed "weakling 0.0.3" + expect(the_bundle).to include_gems "weakling 0.0.3" end private diff --git a/spec/realworld/mirror_probe_spec.rb b/spec/realworld/mirror_probe_spec.rb index aa2d02febd..c46e4e7f20 100644 --- a/spec/realworld/mirror_probe_spec.rb +++ b/spec/realworld/mirror_probe_spec.rb @@ -35,7 +35,7 @@ describe "fetching dependencies with a not available mirror", :realworld => true expect(out).to include("Installing weakling") expect(out).to include("Bundle complete") - expect(the_bundle).to have_installed "weakling 0.0.3" + expect(the_bundle).to include_gems "weakling 0.0.3" end end @@ -55,7 +55,7 @@ describe "fetching dependencies with a not available mirror", :realworld => true expect(out).to include("Installing weakling") expect(out).to include("Bundle complete") - expect(the_bundle).to have_installed "weakling 0.0.3" + expect(the_bundle).to include_gems "weakling 0.0.3" end end diff --git a/spec/runtime/platform_spec.rb b/spec/runtime/platform_spec.rb index 02cb1b036a..666864a88c 100644 --- a/spec/runtime/platform_spec.rb +++ b/spec/runtime/platform_spec.rb @@ -57,7 +57,7 @@ describe "Bundler.setup with multi platform stuff" do gem "nokogiri" G - expect(the_bundle).to have_installed "nokogiri 1.4.2" + expect(the_bundle).to include_gems "nokogiri 1.4.2" end it "will add the resolve for the current platform" do @@ -86,6 +86,6 @@ describe "Bundler.setup with multi platform stuff" do gem "platform_specific" G - expect(the_bundle).to have_installed "nokogiri 1.4.2", "platform_specific 1.0 x86-darwin-100" + expect(the_bundle).to include_gems "nokogiri 1.4.2", "platform_specific 1.0 x86-darwin-100" end end diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index b943cf926e..1e012119a0 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -256,7 +256,7 @@ describe "Bundler.setup" do ENV["BUNDLE_GEMFILE"] = bundled_app("4realz").to_s bundle :install - expect(the_bundle).to have_installed "activesupport 2.3.5" + expect(the_bundle).to include_gems "activesupport 2.3.5" end it "prioritizes gems in BUNDLE_PATH over gems in GEM_HOME" do @@ -270,7 +270,7 @@ describe "Bundler.setup" do s.write "lib/rack.rb", "RACK = 'FAIL'" end - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end describe "integrate with rubygems" do @@ -439,14 +439,14 @@ describe "Bundler.setup" do it "works even when the cache directory has been deleted" do bundle "install --path vendor/bundle" FileUtils.rm_rf vendored_gems("cache") - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end it "does not randomly change the path when specifying --path and the bundle directory becomes read only" do bundle "install --path vendor/bundle" with_read_only("**/*") do - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -454,7 +454,7 @@ describe "Bundler.setup" do bundle "install" with_read_only("#{Bundler.bundle_path}/**/*") do - expect(the_bundle).to have_installed "rack 1.0.0" + expect(the_bundle).to include_gems "rack 1.0.0" end end end @@ -559,7 +559,7 @@ describe "Bundler.setup" do install_gems "activesupport-2.3.5" - expect(the_bundle).to have_installed "activesupport 2.3.2", :groups => :default + expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => :default end it "remembers --without and does not bail on bare Bundler.setup" do @@ -574,7 +574,7 @@ describe "Bundler.setup" do install_gems "activesupport-2.3.5" - expect(the_bundle).to have_installed "activesupport 2.3.2" + expect(the_bundle).to include_gems "activesupport 2.3.2" end it "remembers --without and does not include groups passed to Bundler.setup" do @@ -591,8 +591,8 @@ describe "Bundler.setup" do end G - expect(the_bundle).not_to have_installed "activesupport 2.3.2", :groups => :rack - expect(the_bundle).to have_installed "rack 1.0.0", :groups => :rack + expect(the_bundle).not_to include_gems "activesupport 2.3.2", :groups => :rack + expect(the_bundle).to include_gems "rack 1.0.0", :groups => :rack end end diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 4545feabfa..1e418e1fc2 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -119,7 +119,7 @@ module Spec string.to_s.gsub(/^/, indent_character * padding).gsub("\t", " ") end - define_compound_matcher :have_installed, [be_an_instance_of(Spec::TheBundle)] do |*names| + define_compound_matcher :include_gems, [be_an_instance_of(Spec::TheBundle)] do |*names| match do opts = names.last.is_a?(Hash) ? names.pop : {} source = opts.delete(:source) @@ -192,7 +192,8 @@ module Spec super() + " but:\n" + @errors.map {|e| indent(e) }.join("\n") end end - RSpec::Matchers.define_negated_matcher :not_have_installed, :have_installed + RSpec::Matchers.define_negated_matcher :not_include_gems, :include_gems + RSpec::Matchers.alias_matcher :include_gem, :include_gems def have_lockfile(expected) read_as(strip_whitespace(expected)) diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb index 6228e25ea4..882af27fc3 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -19,7 +19,7 @@ describe "bundle update" do bundle "update" - expect(the_bundle).to have_installed "foo 1.1" + expect(the_bundle).to include_gems "foo 1.1" end it "updates correctly when you have like craziness" do @@ -34,7 +34,7 @@ describe "bundle update" do bundle "update rails" expect(out).to include("Using activesupport 3.0 from #{lib_path("rails")} (at master@#{revision_for(lib_path("rails"))[0..6]})") - expect(the_bundle).to have_installed "rails 3.0", "activesupport 3.0" + expect(the_bundle).to include_gems "rails 3.0", "activesupport 3.0" end it "floats on a branch when :branch is used and the source is specified in the update" do @@ -53,7 +53,7 @@ describe "bundle update" do bundle "update --source foo" - expect(the_bundle).to have_installed "foo 1.1" + expect(the_bundle).to include_gems "foo 1.1" end it "floats on master when updating all gems that are pinned to the source even if you have child dependencies" do @@ -73,7 +73,7 @@ describe "bundle update" do bundle "update foo" - expect(the_bundle).to have_installed "foo 1.1" + expect(the_bundle).to include_gems "foo 1.1" end it "notices when you change the repo url in the Gemfile" do @@ -268,7 +268,7 @@ describe "bundle update" do update_git "foo", "2.0", :path => @git.path bundle "update --source foo" - expect(the_bundle).to have_installed "foo 2.0" + expect(the_bundle).to include_gems "foo 2.0" end it "leaves all other gems frozen" do @@ -276,7 +276,7 @@ describe "bundle update" do update_git "foo", :path => @git.path bundle "update --source foo" - expect(the_bundle).to have_installed "rack 1.0" + expect(the_bundle).to include_gems "rack 1.0" end end |