aboutsummaryrefslogtreecommitdiffstats
path: root/spec/install
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-11-10 20:24:58 -0800
committerAndre Arko <andre@arko.net>2014-11-10 20:24:58 -0800
commit6ba537fc069a75d473080ba3f724ac2aa06346e4 (patch)
tree5766e11fef32b62974fe8c58d8cded2433122967 /spec/install
parent00a795c763d7a67d40ca868e4ad2a7386d712d3e (diff)
parent28b3808c7d9c8331f497fc865569c1ab716f58f1 (diff)
downloadbundler-6ba537fc069a75d473080ba3f724ac2aa06346e4.tar.gz
Merge tag 'v1.7.5'
Version 1.7.5 Conflicts: .travis.yml CHANGELOG.md lib/bundler/fetcher.rb lib/bundler/source_list.rb man/gemfile.5.ronn spec/bundler/source_list_spec.rb
Diffstat (limited to 'spec/install')
-rw-r--r--spec/install/deploy_spec.rb13
-rw-r--r--spec/install/gemfile/path_spec.rb20
-rw-r--r--spec/install/gems/dependency_api_spec.rb2
-rw-r--r--spec/install/gems/simple_case_spec.rb17
-rw-r--r--spec/install/gems/sources_spec.rb13
5 files changed, 52 insertions, 13 deletions
diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb
index 9116a347..f1e91460 100644
--- a/spec/install/deploy_spec.rb
+++ b/spec/install/deploy_spec.rb
@@ -91,6 +91,19 @@ describe "install with --deployment or --frozen" do
expect(exitstatus).to eq(0)
end
+ it "works with sources given by a block" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}" do
+ gem "rack"
+ end
+ G
+
+ bundle "install --deployment", :exitstatus => true
+
+ expect(exitstatus).to eq(0)
+ should_be_installed "rack 1.0"
+ end
+
describe "with an existing lockfile" do
before do
bundle "install"
diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb
index f36f3838..f88b6aa2 100644
--- a/spec/install/gemfile/path_spec.rb
+++ b/spec/install/gemfile/path_spec.rb
@@ -415,6 +415,26 @@ describe "bundle install with explicit source paths" do
end
end
+ describe "when there are both a gemspec and remote gems" do
+ it "doesn't query rubygems for local gemspec name" do
+ build_lib "private_lib", "2.2", :path => lib_path("private_lib")
+ gemfile = <<-G
+ source "http://localgemserver.test"
+ gemspec
+ gem 'rack'
+ G
+ File.open(lib_path("private_lib/Gemfile"), "w") {|f| f.puts gemfile }
+
+ Dir.chdir(lib_path("private_lib")) do
+ bundle :install, :env => {"DEBUG" => 1}, :artifice => "endpoint"
+ expect(out).to match(/^HTTP GET http:\/\/localgemserver\.test\/api\/v1\/dependencies\?gems=rack$/)
+ expect(out).not_to match(/^HTTP GET.*private_lib/)
+ should_be_installed "private_lib 2.2"
+ should_be_installed "rack 1.0"
+ end
+ end
+ end
+
describe "gem install hooks" do
it "runs pre-install hooks" do
build_git "foo"
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb
index 863fb142..dc9e0109 100644
--- a/spec/install/gems/dependency_api_spec.rb
+++ b/spec/install/gems/dependency_api_spec.rb
@@ -467,6 +467,8 @@ describe "gemcutter's dependency API" do
bundle "config #{source_uri}/ #{user}:#{password}"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
+
+ expect(out).to include("Fetching gem metadata from #{source_uri}")
should_be_installed "rack 1.0.0"
end
diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb
index 7fbd9e0e..aac70db6 100644
--- a/spec/install/gems/simple_case_spec.rb
+++ b/spec/install/gems/simple_case_spec.rb
@@ -291,7 +291,7 @@ describe "bundle install with gem sources" do
G
bundle :install, :expect_err => true
- expect(out).to match(/Your Gemfile has no gem server sources/i)
+ expect(out).to include("Your Gemfile has no gem server sources")
end
it "creates a Gemfile.lock on a blank Gemfile" do
@@ -363,23 +363,14 @@ describe "bundle install with gem sources" do
end
describe "when requesting a quiet install via --quiet" do
- it "should be quiet if there are no warnings" do
- gemfile <<-G
- source "file://#{gem_repo1}"
- gem 'rack'
- G
-
- bundle :install, :quiet => true
- expect(out).to eq("")
- end
-
- it "should still display warnings" do
+ it "should be quiet" do
gemfile <<-G
gem 'rack'
G
bundle :install, :quiet => true
- expect(out).to match(/Your Gemfile has no gem server sources/)
+ expect(out).to include("Could not find gem 'rack (>= 0) ruby'")
+ expect(out).to_not include("Your Gemfile has no gem server sources")
end
end
diff --git a/spec/install/gems/sources_spec.rb b/spec/install/gems/sources_spec.rb
index d45e25c7..e3ab84c0 100644
--- a/spec/install/gems/sources_spec.rb
+++ b/spec/install/gems/sources_spec.rb
@@ -72,6 +72,7 @@ describe "bundle install with gems on multiple sources" do
gemfile <<-G
source "file://#{gem_repo3}"
source "file://#{gem_repo1}" do
+ gem "thin" # comes first to test name sorting
gem "rack"
end
gem "rack-obama" # shoud come from repo3!
@@ -83,6 +84,18 @@ 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", :exitstatus => true
+
+ expect(exitstatus).to eq(0)
+ should_be_installed("rack-obama 1.0.0", "rack 1.0.0")
+ end
end
context "with sources set by an option" do