diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-09-21 14:00:11 +0200 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-09-21 14:00:11 +0200 |
commit | 6775f652cf812eb6222a4486c5cf6c6ebfc281ea (patch) | |
tree | 4add09d5f0855daae961deb929929bdd405cb3df | |
parent | 0ce612b6c2f165e4505f1b17fe81e35274b51acc (diff) | |
download | bundler-6775f652cf812eb6222a4486c5cf6c6ebfc281ea.tar.gz |
Add a spec for lazy specification picking the right platform for Gemspec sources
-rw-r--r-- | spec/install/gemfile/gemspec_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 9a6bd5f1e8..698756525c 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -409,4 +409,37 @@ describe "bundle install from an existing gemspec" do end end end + + context "with multiple platforms" do + before do + build_lib("foo", :path => tmp.join("foo")) do |s| + s.version = "1.0.0" + s.add_development_dependency "rack" + s.write "foo-universal-java.gemspec", build_spec("foo", "1.0.0", "universal-java") {|sj| sj.runtime "rack", "1.0.0" }.first.to_ruby + end + end + + it "installs the ruby platform gemspec" do + simulate_platform "ruby" + + install_gemfile! <<-G + source "file://#{gem_repo1}" + gemspec :path => '#{tmp.join("foo")}', :name => 'foo' + G + + expect(the_bundle).to include_gems "foo 1.0.0", "rack 1.0.0" + end + + it "installs the ruby platform gemspec and skips dev deps with --without development" do + simulate_platform "ruby" + + install_gemfile! <<-G, :without => "development" + source "file://#{gem_repo1}" + gemspec :path => '#{tmp.join("foo")}', :name => 'foo' + G + + expect(the_bundle).to include_gem "foo 1.0.0" + expect(the_bundle).not_to include_gem "rack" + end + end end |