summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-03-30 12:01:32 +0100
committerAndre Arko <andre@arko.net>2015-03-30 12:04:29 +0100
commit5a1735ae100478179a5507f09659f79d6d52af52 (patch)
tree32bb25d2ff915eae2dd07ee14d334d858bffaedf
parent598c4ee83f233048fee38b59c21ebf140a24efe5 (diff)
downloadbundler-5a1735ae100478179a5507f09659f79d6d52af52.tar.gz
update the failing spec to correctly repro the bug
-rw-r--r--spec/install/gems/sources_spec.rb31
-rw-r--r--spec/support/builders.rb13
2 files changed, 33 insertions, 11 deletions
diff --git a/spec/install/gems/sources_spec.rb b/spec/install/gems/sources_spec.rb
index ddbb508749..a89afea627 100644
--- a/spec/install/gems/sources_spec.rb
+++ b/spec/install/gems/sources_spec.rb
@@ -292,13 +292,22 @@ describe "bundle install with gems on multiple sources" do
context "when a single source contains multiple locked gems" do
before do
+ # 1. With these gems,
build_repo4 do
- build_gem "foo", "0.2"
+ build_gem "foo", "0.1"
build_gem "bar", "0.1"
- build_gem "bar", "0.3"
end
- lockfile <<-G
+ # 2. Installing this gemfile will produce...
+ gemfile <<-G
+ source 'file://#{gem_repo1}'
+ gem 'rack'
+ gem 'foo', '~> 0.1', source: 'file://#{gem_repo4}'
+ gem 'bar', '~> 0.1', source: 'file://#{gem_repo4}'
+ G
+
+ # 3. this lockfile.
+ lockfile <<-L
GEM
remote: file:/Users/andre/src/bundler/bundler/tmp/gems/remote1/
remote: file:/Users/andre/src/bundler/bundler/tmp/gems/remote4/
@@ -311,13 +320,22 @@ describe "bundle install with gems on multiple sources" do
ruby
DEPENDENCIES
- bar (= 0.1)!
- foo (= 0.1)!
+ bar (~> 0.1)!
+ foo (~> 0.1)!
rack
- G
+ L
+
+ bundle "install --path ../gems/system"
+
+ # 4. Then we add some new versions...
+ update_repo4 do
+ build_gem "foo", "0.2"
+ 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'
@@ -325,6 +343,7 @@ describe "bundle install with gems on multiple sources" do
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
diff --git a/spec/support/builders.rb b/spec/support/builders.rb
index dadaa731ce..1b2670b4ab 100644
--- a/spec/support/builders.rb
+++ b/spec/support/builders.rb
@@ -260,12 +260,15 @@ module Spec
FileUtils.rm_rf Dir[gem_repo3("prerelease*")]
end
- # A repo that has no pre-installed gems included. (The caller completely determines the contents with the block)
- def build_repo4(&blk)
+ # A repo that has no pre-installed gems included. (The caller completely
+ # determines the contents with the block.)
+ def build_repo4
FileUtils.rm_rf gem_repo4
- build_repo(gem_repo4) do
- yield if block_given?
- end
+ build_repo(gem_repo4) { yield }
+ end
+
+ def update_repo4
+ update_repo(gem_repo4) { yield }
end
def update_repo2