diff options
author | Andre Arko <andre@arko.net> | 2015-03-30 12:01:32 +0100 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-03-30 12:01:32 +0100 |
commit | e602472c87d7cd30de6fc3bbb4c94c85437ca21b (patch) | |
tree | 0f72d8df7283498bc5a21d2124fd3e0aa0065aed | |
parent | 2cd1ffa0adfb88b70192403dba4886409dab77c1 (diff) | |
download | bundler-e602472c87d7cd30de6fc3bbb4c94c85437ca21b.tar.gz |
update the failing spec to correctly repro the bug
-rw-r--r-- | spec/install/gems/sources_spec.rb | 31 | ||||
-rw-r--r-- | spec/support/builders.rb | 13 |
2 files changed, 33 insertions, 11 deletions
diff --git a/spec/install/gems/sources_spec.rb b/spec/install/gems/sources_spec.rb index af3e9c2e3e..95438b755d 100644 --- a/spec/install/gems/sources_spec.rb +++ b/spec/install/gems/sources_spec.rb @@ -322,13 +322,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/ @@ -341,13 +350,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' @@ -355,6 +373,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 5490a2b976..1a1c916779 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 |