aboutsummaryrefslogtreecommitdiffstats
path: root/spec/install
diff options
context:
space:
mode:
authorDylan Thacker-Smith <Dylan.Smith@shopify.com>2014-03-28 14:00:29 -0400
committerDylan Thacker-Smith <Dylan.Smith@shopify.com>2014-03-30 13:22:52 -0400
commitd98f3f9ba83bc67c6f566a928b78ff0a7ba06420 (patch)
tree47ab25bf5afa67c2fdc829633925e16a94a80679 /spec/install
parent029dc28e3f1148c872c049eedd0e47196e7187a6 (diff)
downloadbundler-d98f3f9ba83bc67c6f566a928b78ff0a7ba06420.tar.gz
Use git sha as part of extension directory for git referenced gems.
Fixes #2947
Diffstat (limited to 'spec/install')
-rw-r--r--spec/install/gemfile/git_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb
index 4933727b..5d83e47b 100644
--- a/spec/install/gemfile/git_spec.rb
+++ b/spec/install/gemfile/git_spec.rb
@@ -854,6 +854,43 @@ describe "bundle install with git sources" do
expect(out).to eq("YES")
end
+ it "does not use old extension after ref changes" do
+ git_reader = build_git "foo", :no_default => true do |s|
+ s.extensions = ["ext/extconf.rb"]
+ s.write "ext/extconf.rb", <<-RUBY
+ require "mkmf"
+ create_makefile("foo")
+ RUBY
+ s.write "ext/foo.c", "void Init_foo() {}"
+ end
+
+ 2.times do |i|
+ Dir.chdir(git_reader.path) do
+ File.open("ext/foo.c", "w") do |file|
+ file.write <<-C
+ #include "ruby.h"
+ VALUE foo() { return INT2FIX(#{i}); }
+ void Init_foo() { rb_define_global_function("foo", &foo, 0); }
+ C
+ end
+ `git commit -m 'commit for iteration #{i}' ext/foo.c`
+ end
+ git_sha = git_reader.ref_for("HEAD")
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "foo", :git => "#{lib_path('foo-1.0')}", :ref => "#{git_sha}"
+ G
+
+ run <<-R
+ require 'foo'
+ puts foo
+ R
+
+ expect(out).to eq(i.to_s)
+ end
+ end
+
it "does not prompt to gem install if extension fails" do
build_git "foo" do |s|
s.add_dependency "rake"