diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-01-29 11:29:02 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-01-29 11:29:02 -0800 |
commit | 6a344b8cbb0fc6d740a0f0f030f0e427b9c79bfc (patch) | |
tree | 28069326b1c65fd58b682b756259479815f255c4 | |
parent | 1f79a0fe48ef870ad86c53ccd1081aca0f063066 (diff) | |
download | bundler-6a344b8cbb0fc6d740a0f0f030f0e427b9c79bfc.tar.gz |
Don't blow up if there are development dependencies.
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | spec/install/gems_spec.rb | 10 | ||||
-rw-r--r-- | spec/support/builders.rb | 4 | ||||
-rw-r--r-- | spec/support/matchers.rb | 11 |
4 files changed, 24 insertions, 3 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 9ee104d234..452577fe29 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -76,7 +76,7 @@ module Bundler def group_spec(specs, spec, group) spec.groups << group spec.groups.uniq! - spec.dependencies.each do |d| + spec.dependencies.select { |d| d.type != :development }.each do |d| spec = specs.find { |s| s.name == d.name } group_spec(specs, spec, group) end diff --git a/spec/install/gems_spec.rb b/spec/install/gems_spec.rb index 70e3404b1c..320a6d7f0e 100644 --- a/spec/install/gems_spec.rb +++ b/spec/install/gems_spec.rb @@ -41,6 +41,16 @@ describe "gemfile install with gem sources" do should_be_installed "rack 0.9.1" end + it "does not install the development dependency" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "with_development_dependency" + G + + should_be_installed "with_development_dependency 1.0.0" + should_not_be_installed "activesupport 2.3.5" + end + it "resolves correctly" do install_gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/support/builders.rb b/spec/support/builders.rb index c637412ad4..8a2970e63c 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -72,6 +72,10 @@ module Spec build_gem "very-simple-prerelease", "1.0.pre" + build_gem "with_development_dependency" do |s| + s.add_development_dependency "activesupport", "= 2.3.5" + end + build_gem "very_simple_binary" do |s| s.require_paths << 'ext' s.extensions << "ext/extconf.rb" diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 91ec143263..bb132510df 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -28,8 +28,15 @@ module Spec def should_not_be_installed(*names) names.each do |name| name, version = name.split(/\s+/) - run "require '#{name}'; puts #{Spec::Builders.constantize(name)}" - Gem::Version.new(out).should_not == Gem::Version.new(version) + run <<-R + begin + require '#{name}' + puts #{Spec::Builders.constantize(name)} + rescue LoadError + puts "WIN" + end + R + out.should == "WIN" || Gem::Version.new(out).should_not == Gem::Version.new(version) end end end |