diff options
author | Homu <homu@barosl.com> | 2016-04-15 05:34:49 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2016-04-15 05:34:49 +0900 |
commit | a93306067e347581fabc2dc0bf6fe224757302c4 (patch) | |
tree | 6d82f6bdf5dd59e0c276c497bba7d5de60d4e965 /spec/commands/package_spec.rb | |
parent | 3a09448d8b060f2688dbc73bfa1eb08e1bd126f3 (diff) | |
parent | 762ddfaeb5e050112f5a78b30be4db1819d49670 (diff) | |
download | bundler-a93306067e347581fabc2dc0bf6fe224757302c4.tar.gz |
Auto merge of #4439 - RochesterinNYC:fix-recursive-bundle-package-loop-with-multiple-gemspecs, r=segiddins
Handle recursive bundle package loop when multiple gemspecs present
`root_gem_names` should contain the names of the gems that the gemspecs in the directory are correlated with. Gems are packaged unless they're called `bundler` or their names match with the gems specified in the gemspecs.
- Handles multiple gemspecs in directory
- Handles case where gemspec file name does not match with the gem name specified in the gemspec
- Fixes #4430
Diffstat (limited to 'spec/commands/package_spec.rb')
-rw-r--r-- | spec/commands/package_spec.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb index 8cf6de4c..3e4b6029 100644 --- a/spec/commands/package_spec.rb +++ b/spec/commands/package_spec.rb @@ -95,6 +95,51 @@ describe "bundle package" do end end end + + context "with multiple gemspecs" do + before do + File.open(bundled_app("mygem.gemspec"), "w") do |f| + f.write <<-G + Gem::Specification.new do |s| + s.name = "mygem" + s.version = "0.1.1" + s.summary = "" + s.authors = ["gem author"] + s.add_development_dependency "nokogiri", "=1.4.2" + end + G + end + File.open(bundled_app("mygem_client.gemspec"), "w") do |f| + f.write <<-G + Gem::Specification.new do |s| + s.name = "mygem_test" + s.version = "0.1.1" + s.summary = "" + s.authors = ["gem author"] + s.add_development_dependency "weakling", "=0.0.3" + end + G + end + end + + it "caches all dependencies except bundler and the gemspec specified gems" do + gemfile <<-D + source "file://#{gem_repo1}" + gem 'rack' + gemspec :name => 'mygem' + gemspec :name => 'mygem_client' + D + + bundle! "package --all" + + expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist + expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist + expect(bundled_app("vendor/cache/weakling-0.0.3.gem")).to exist + expect(bundled_app("vendor/cache/mygem-0.1.1.gem")).to_not exist + expect(bundled_app("vendor/cache/mygem_test-0.1.1.gem")).to_not exist + expect(bundled_app("vendor/cache/bundler-0.9.gem")).to_not exist + end + end end context "with --path" do |