Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added test coverage for the dependency type bug

  • Loading branch information...
commit 29d62eabed17ecde644e42719ddff44c3d3fd5f0 1 parent c2719ab
@raggi raggi authored
Showing with 22 additions and 0 deletions.
  1. +1 −0  lib/bundler/definition.rb
  2. +21 −0 spec/install/gemspec_spec.rb
View
1  lib/bundler/definition.rb
@@ -81,6 +81,7 @@ def fixup_dependency_types!
# add_development_dependency in a gemspec that's loaded with the gemspec
# directive, the lockfile dependencies and resolved dependencies end up
# with a mismatch on #type.
+ # Test coverage to catch a regression on this is in gemspec_spec.rb
@dependencies.each do |d|
if ld = @locked_deps.find { |l| l.name == d.name }
ld.instance_variable_set(:@type, d.type)
View
21 spec/install/gemspec_spec.rb
@@ -110,6 +110,27 @@
should_be_installed "bar-dev 1.0.0", :groups => :dev
end
+ it "should match a lockfile even if the gemspec defines development dependencies" do
+ build_lib("foo", :path => tmp.join("foo")) do |s|
+ s.write("Gemfile", "source 'file://#{gem_repo1}'\ngemspec")
+ s.add_dependency "actionpack", "=2.3.2"
+ s.add_development_dependency "rake", '=0.8.7'
+ end
+
+ Dir.chdir(tmp.join("foo")) do
+ bundle "install"
+ # This should really be able to rely on $stderr, but, it's not written
+ # right, so we can't. In fact, this is a bug negation test, and so it'll
+ # ghost pass in future, and will only catch a regression if the message
+ # doesn't change. Exit codes should be used correctly (they can be more
+ # than just 0 and 1).
+ output = bundle("install --deployment")
+ output.should_not match(/You have added to the Gemfile/)
+ output.should_not match(/You have deleted from the Gemfile/)
+ output.should_not match(/install in deployment mode after changing/)
+ end
+ end
+
it "should evaluate the gemspec in its directory" do
build_lib("foo", :path => tmp.join("foo"))
File.open(tmp.join("foo/foo.gemspec"), "w") do |s|
Please sign in to comment.
Something went wrong with that request. Please try again.