diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-02-22 17:35:19 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-02-22 17:35:31 -0800 |
commit | 259224514e68ab4fde89b79c442d6546a99a83d8 (patch) | |
tree | 45d4241f9b0d98dd3ced1db6b01e6e0f6419895e /spec | |
parent | 0b74627b71515df2fe4ce83d1ac0569aec62f3a1 (diff) | |
download | bundler-259224514e68ab4fde89b79c442d6546a99a83d8.tar.gz |
Gems with implicit Rake dependencies (extensions << "Rakefile") work!
Diffstat (limited to 'spec')
-rw-r--r-- | spec/install/gems_spec.rb | 12 | ||||
-rw-r--r-- | spec/support/builders.rb | 20 | ||||
-rw-r--r-- | spec/support/rubygems_ext.rb | 4 |
3 files changed, 31 insertions, 5 deletions
diff --git a/spec/install/gems_spec.rb b/spec/install/gems_spec.rb index c952d905..f977cf33 100644 --- a/spec/install/gems_spec.rb +++ b/spec/install/gems_spec.rb @@ -333,6 +333,18 @@ describe "bundle install with gem sources" do end end + describe "native dependencies" do + it "installs gems with implicit rake dependencies" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "with_implicit_rake_dep" + G + + run "require 'implicit_rake_dep'; puts IMPLICIT_RAKE_DEP" + out.should == "YES" + end + end + describe "when specifying groups not excluded" do before :each do install_gemfile <<-G diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 24a93740..5ab80934 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -6,9 +6,6 @@ module Spec def build_repo1 build_repo gem_repo1 do - build_gem "rake", "0.8.7" do |s| - s.executables = "rake" - end build_gem "rack", %w(0.9.1 1.0.0) do |s| s.executables = "rackup" end @@ -86,6 +83,19 @@ module Spec s.add_development_dependency "activesupport", "= 2.3.5" end + 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 "very_simple_binary" do |s| s.require_paths << 'ext' s.extensions << "ext/extconf.rb" @@ -131,6 +141,10 @@ module Spec def build_repo(path, &blk) return if File.directory?(path) + # If this is nil, rm -rf tmp + rake_path = Dir["#{Path.base_system_gems}/**/rake*.gem"].first + FileUtils.mkdir_p("#{path}/gems") + FileUtils.cp rake_path, "#{path}/gems/" update_repo(path, &blk) end diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb index 7c534c3a..91636b07 100644 --- a/spec/support/rubygems_ext.rb +++ b/spec/support/rubygems_ext.rb @@ -8,8 +8,8 @@ module Spec unless File.exist?("#{Path.base_system_gems}") FileUtils.mkdir_p(Path.base_system_gems) - puts "running `gem install builder --no-rdoc --no-ri`" - `gem install builder --no-rdoc --no-ri` + puts "running `gem install builder rake --no-rdoc --no-ri`" + `gem install builder rake --no-rdoc --no-ri` end ENV['HOME'] = Path.home.to_s |