diff options
author | Caden Lovelace <caden@herostrat.us> | 2015-06-18 18:44:21 +0100 |
---|---|---|
committer | Caden Lovelace <caden@herostrat.us> | 2015-08-23 23:47:48 +0100 |
commit | c8f7985e95727472c9ad3f77e07a4621ae58c5e4 (patch) | |
tree | 44230433982458b0ebf2d4dd558bfbc708179c8e /spec/update | |
parent | a7caaa51e3087df6e0a1627b020f34e8aaada595 (diff) | |
download | bundler-c8f7985e95727472c9ad3f77e07a4621ae58c5e4.tar.gz |
Add test for updating gems on source when source differs to name
Diffstat (limited to 'spec/update')
-rw-r--r-- | spec/update/git_spec.rb | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb index b19673036c..2e2cbd0819 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -278,5 +278,56 @@ describe "bundle update" do bundle "update --source foo" should_be_installed "rack 1.0" end + + context "when the gem and the repository have different names" do + before :each do + build_repo2 + @git = build_git "foo", :path => lib_path("bar") + + install_gemfile <<-G + source "file://#{gem_repo2}" + git "#{lib_path("bar")}" do + gem 'foo' + end + gem 'rack' + G + end + + it "updates version of gems that were originally pulled in by the source" do + spec_lines = lib_path("foo/foo.gemspec").read.split("\n") + spec_lines[5] = "s.version = '2.0'" + + update_git "foo", "2.0", :path => @git.path do |s| + s.write "foo.gemspec", spec_lines.join("\n") + end + + ref = @git.ref_for "master" + + bundle "update --source bar" + + lockfile_should_be <<-G + GIT + remote: #{@git.path} + revision: #{ref} + specs: + foo (2.0) + + GEM + remote: file:#{gem_repo2}/ + specs: + rack (1.0.0) + + PLATFORMS + ruby + + DEPENDENCIES + foo! + rack + + BUNDLED WITH + #{Bundler::VERSION} + G + end + end end end |