summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Lance <stefan@lances.net>2015-09-11 01:20:12 -0500
committerStefan Lance <stefan@lances.net>2015-09-11 01:20:12 -0500
commita7d063c59c1e6179b25b9ae9d26afeca431ff010 (patch)
tree1fe32ea6bcaa4b23b110b541ab349216b315265b
parent0e6b5ef10fc339246d2fd89fcccaac6653b484ea (diff)
downloadbundler-a7d063c59c1e6179b25b9ae9d26afeca431ff010.tar.gz
Modify and remove original failing specs
-rw-r--r--spec/commands/install_spec.rb10
-rw-r--r--spec/install/gems/dependency_api_spec.rb125
-rw-r--r--spec/install/gems/sources_spec.rb67
-rw-r--r--spec/lock/lockfile_spec.rb30
4 files changed, 9 insertions, 223 deletions
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index df88fbfd4f..a118618524 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -281,11 +281,13 @@ describe "bundle install with gem sources" do
update_repo2
install_gemfile <<-G
- source "file://#{gem_repo1}"
- source "file://#{gem_repo2}"
+ source "file://#{gem_repo1}" do
+ gem "activesupport", "1.2.3"
+ end
- gem "activesupport", "1.2.3"
- gem "rack", "1.2"
+ source "file://#{gem_repo2}" do
+ gem "rack", "1.2"
+ end
G
should_be_installed "rack 1.2", "activesupport 1.2.3"
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb
index 9c0dec5eb5..2e5acc1ed6 100644
--- a/spec/install/gems/dependency_api_spec.rb
+++ b/spec/install/gems/dependency_api_spec.rb
@@ -242,24 +242,6 @@ describe "gemcutter's dependency API" do
end
end
- it "fetches again when more dependencies are found in subsequent sources" do
- build_repo2 do
- build_gem "back_deps" do |s|
- s.add_dependency "foo"
- end
- FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
- end
-
- gemfile <<-G
- source "#{source_uri}"
- source "#{source_uri}/extra"
- gem "back_deps"
- G
-
- bundle :install, :artifice => "endpoint_extra"
- should_be_installed "back_deps 1.0"
- end
-
it "fetches gem versions even when those gems are already installed" do
gemfile <<-G
source "#{source_uri}"
@@ -275,79 +257,12 @@ describe "gemcutter's dependency API" do
gemfile <<-G
source "#{source_uri}" do; end
- source "#{source_uri}/extra"
- gem "rack", "1.2"
- G
- bundle :install, :artifice => "endpoint_extra_api"
- should_be_installed "rack 1.2"
- end
-
- it "considers all possible versions of dependencies from all api gem sources" do
- # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
- # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
- # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
- # repo and installs it.
- build_repo4 do
- build_gem "activesupport", "1.2.0"
- build_gem "somegem", "1.0.0" do |s|
- s.add_dependency "activesupport", "1.2.3" # This version exists only in repo1
+ source "#{source_uri}/extra" do
+ gem "rack", "1.2"
end
- end
-
- gemfile <<-G
- source "#{source_uri}"
- source "#{source_uri}/extra"
- gem 'somegem', '1.0.0'
G
-
bundle :install, :artifice => "endpoint_extra_api"
-
- should_be_installed "somegem 1.0.0"
- should_be_installed "activesupport 1.2.3"
- end
-
- it "prints API output properly with back deps" do
- build_repo2 do
- build_gem "back_deps" do |s|
- s.add_dependency "foo"
- end
- FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
- end
-
- gemfile <<-G
- source "#{source_uri}"
- source "#{source_uri}/extra"
- gem "back_deps"
- G
-
- bundle :install, :artifice => "endpoint_extra"
-
- expect(out).to include("Fetching gem metadata from http://localgemserver.test/..")
- expect(out).to include("Fetching source index from http://localgemserver.test/extra")
- end
-
- it "does not fetch every spec if the index of gems is large when doing back deps" do
- build_repo2 do
- build_gem "back_deps" do |s|
- s.add_dependency "foo"
- end
- build_gem "missing"
- # need to hit the limit
- 1.upto(Bundler::Source::Rubygems::API_REQUEST_LIMIT) do |i|
- build_gem "gem#{i}"
- end
-
- FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
- end
-
- gemfile <<-G
- source "#{source_uri}"
- source "#{source_uri}/extra"
- gem "back_deps"
- G
-
- bundle :install, :artifice => "endpoint_extra_missing"
- should_be_installed "back_deps 1.0"
+ should_be_installed "rack 1.2"
end
it "uses the endpoint if all sources support it" do
@@ -361,26 +276,6 @@ describe "gemcutter's dependency API" do
should_be_installed "foo 1.0"
end
- it "fetches again when more dependencies are found in subsequent sources using --deployment" do
- build_repo2 do
- build_gem "back_deps" do |s|
- s.add_dependency "foo"
- end
- FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
- end
-
- gemfile <<-G
- source "#{source_uri}"
- source "#{source_uri}/extra"
- gem "back_deps"
- G
-
- bundle :install, :artifice => "endpoint_extra"
-
- bundle "install --deployment", :artifice => "endpoint_extra"
- should_be_installed "back_deps 1.0"
- end
-
it "does not refetch if the only unmet dependency is bundler" do
gemfile <<-G
source "#{source_uri}"
@@ -493,20 +388,6 @@ describe "gemcutter's dependency API" do
expect(err).not_to include("#{user}:#{password}")
end
- it "strips http basic auth creds when warning about ambiguous sources" do
- gemfile <<-G
- source "#{basic_auth_source_uri}"
- source "file://#{gem_repo1}"
- gem "rack"
- G
-
- bundle :install, :artifice => "endpoint_basic_authentication"
- expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(out).not_to include("#{user}:#{password}")
- expect(err).not_to include("#{user}:#{password}")
- should_be_installed "rack 1.0.0"
- end
-
it "does not pass the user / password to different hosts on redirect" do
gemfile <<-G
source "#{basic_auth_source_uri}"
diff --git a/spec/install/gems/sources_spec.rb b/spec/install/gems/sources_spec.rb
index 99d0a31898..c797776748 100644
--- a/spec/install/gems/sources_spec.rb
+++ b/spec/install/gems/sources_spec.rb
@@ -27,15 +27,6 @@ describe "bundle install with gems on multiple sources" do
G
end
- it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first" do
- bundle :install
-
- expect(err).to include("DEPRECATION: Your gems.rb contains multiple primary sources.")
- expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include("Installed from: file:#{gem_repo1}")
- should_be_installed("rack-obama 1.0.0", "rack 1.0.0")
- end
-
it "errors when disable_multisource is set" do
bundle "config disable_multisource true"
bundle :install
@@ -55,15 +46,6 @@ describe "bundle install with gems on multiple sources" do
gem "rack", "1.0.0" # force it to install the working version in repo1
G
end
-
- it "warns about ambiguous gems, but installs anyway" do
- bundle :install
-
- expect(err).to include("DEPRECATION: Your gems.rb contains multiple primary sources.")
- expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include("Installed from: file:#{gem_repo1}")
- should_be_installed("rack-obama 1.0.0", "rack 1.0.0")
- end
end
end
@@ -93,18 +75,6 @@ describe "bundle install with gems on multiple sources" do
expect(out).not_to include("Warning")
should_be_installed("rack-obama 1.0.0", "rack 1.0.0")
end
-
- it "can cache and deploy" do
- bundle :package
-
- expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
- expect(bundled_app("vendor/cache/rack-obama-1.0.gem")).to exist
-
- bundle "install --deployment"
-
- expect(exitstatus).to eq(0) if exitstatus
- should_be_installed("rack-obama 1.0.0", "rack 1.0.0")
- end
end
context "with sources set by an option" do
@@ -220,14 +190,6 @@ describe "bundle install with gems on multiple sources" do
end
G
end
-
- it "installs from the other source and warns about ambiguous gems" do
- bundle :install
- expect(err).to include("DEPRECATION: Your gems.rb contains multiple primary sources.")
- expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(err).to include("Installed from: file:#{gem_repo2}")
- should_be_installed("depends_on_rack 1.0.1", "rack 1.0.0")
- end
end
context "and only the dependency is pinned" do
@@ -247,21 +209,6 @@ describe "bundle install with gems on multiple sources" do
gem "rack", :source => "file://#{gem_repo1}"
G
end
-
- it "installs the dependency from the pinned source without warning" do
- bundle :install
-
- expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")
- should_be_installed("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
- system_gems []
- bundle :install
-
- expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")
- should_be_installed("depends_on_rack 1.0.1", "rack 1.0.0")
- end
end
end
end
@@ -398,19 +345,5 @@ describe "bundle install with gems on multiple sources" do
build_gem "bar", "0.3"
end
end
-
- it "allows them to be unlocked separately" do
- # 5. and install this gemfile, updating only foo.
- install_gemfile <<-G
- source 'file://#{gem_repo1}'
- gem 'rack'
- gem 'foo', '~> 0.2', :source => 'file://#{gem_repo4}'
- gem 'bar', '~> 0.1', :source => 'file://#{gem_repo4}'
- G
-
- # 6. Which should update foo to 0.2, but not the (locked) bar 0.1
- should_be_installed("foo 0.2")
- should_be_installed("bar 0.1")
- end
end
end
diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb
index 564dbaadc7..325c09f524 100644
--- a/spec/lock/lockfile_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -358,36 +358,6 @@ describe "the lockfile format" do
G
end
- it "generates a lockfile wihout credentials for a configured source" do
- bundle "config http://localgemserver.test/ user:pass"
-
- install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
- source "http://localgemserver.test/"
- source "http://user:pass@othergemserver.test/"
-
- gem "rack-obama", ">= 1.0"
- G
-
- lockfile_should_be <<-G
- GEM
- remote: http://localgemserver.test/
- remote: http://user:pass@othergemserver.test/
- specs:
- rack (1.0.0)
- rack-obama (1.0)
- rack
-
- PLATFORMS
- #{generic(Gem::Platform.local)}
-
- DEPENDENCIES
- rack-obama (>= 1.0)
-
- BUNDLED WITH
- #{Bundler::VERSION}
- G
- end
-
it "generates lockfiles with multiple requirements" do
install_gemfile <<-G
source "file://#{gem_repo1}"