diff options
Diffstat (limited to 'spec/bundler/install/gems/resolving_spec.rb')
-rw-r--r-- | spec/bundler/install/gems/resolving_spec.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/bundler/install/gems/resolving_spec.rb b/spec/bundler/install/gems/resolving_spec.rb index 035ed9a7f3..94fac0052c 100644 --- a/spec/bundler/install/gems/resolving_spec.rb +++ b/spec/bundler/install/gems/resolving_spec.rb @@ -3,6 +3,32 @@ RSpec.describe "bundle install with install-time dependencies" do before do build_repo2 do + build_gem "with_implicit_rake_dep" do |s| + s.extensions << "Rakefile" + s.write "Rakefile", <<-RUBY + task :default do + path = File.expand_path("../lib", __FILE__) + FileUtils.mkdir_p(path) + File.open("\#{path}/implicit_rake_dep.rb", "w") do |f| + f.puts "IMPLICIT_RAKE_DEP = 'YES'" + end + end + RUBY + end + + build_gem "another_implicit_rake_dep" do |s| + s.extensions << "Rakefile" + s.write "Rakefile", <<-RUBY + task :default do + path = File.expand_path("../lib", __FILE__) + FileUtils.mkdir_p(path) + File.open("\#{path}/another_implicit_rake_dep.rb", "w") do |f| + f.puts "ANOTHER_IMPLICIT_RAKE_DEP = 'YES'" + end + end + RUBY + end + # Test complicated gem dependencies for install build_gem "net_a" do |s| s.add_dependency "net_b" @@ -55,6 +81,25 @@ RSpec.describe "bundle install with install-time dependencies" do expect(out).to eq("YES\nYES") end + it "installs gems with implicit rake dependencies without rake previously installed" do + with_path_as("") do + install_gemfile <<-G + source "#{file_uri_for(gem_repo2)}" + gem "with_implicit_rake_dep" + gem "another_implicit_rake_dep" + gem "rake" + G + end + + run <<-R + require 'implicit_rake_dep' + require 'another_implicit_rake_dep' + puts IMPLICIT_RAKE_DEP + puts ANOTHER_IMPLICIT_RAKE_DEP + R + expect(out).to eq("YES\nYES") + end + it "installs gems with a dependency with no type" do skip "incorrect data check error" if Gem.win_platform? |