diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2018-10-02 21:38:23 -0700 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2018-10-02 21:38:23 -0700 |
commit | a04d97d1bab4c4ffcb65484192cc9ea200de7b09 (patch) | |
tree | 08cfc809de900d4507d3ed6db1c9fdb65c776ca3 /spec/install/gemfile | |
parent | 2264db9b12cf7ef74163b711baea95cfd91411e4 (diff) | |
download | bundler-a04d97d1bab4c4ffcb65484192cc9ea200de7b09.tar.gz |
Add another spec, separate new case into its own test
Diffstat (limited to 'spec/install/gemfile')
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index 843a177af4..651deb3265 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -1211,6 +1211,47 @@ In Gemfile: install_gemfile <<-G source "file://#{gem_repo1}" + gem "foo", :git => "#{lib_path("foo-1.0")}" + G + + run! <<-R + require 'foo' + puts FOO + R + + installed_time = out + expect(installed_time).to match(/\A\d+\.\d+\z/) + + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "foo", :git => "#{lib_path("foo-1.0")}" + G + + run! <<-R + require 'foo' + puts FOO + R + expect(out).to eq(installed_time) + end + + it "does not reinstall the extension when changing another gem", :rubygems => ">= 2.3.0" do + build_git "foo" do |s| + s.add_dependency "rake" + s.extensions << "Rakefile" + s.write "Rakefile", <<-RUBY + task :default do + path = File.expand_path("../lib", __FILE__) + FileUtils.mkdir_p(path) + cur_time = Time.now.to_f.to_s + File.open("\#{path}/foo.rb", "w") do |f| + f.puts "FOO = \#{cur_time}" + end + end + RUBY + end + + install_gemfile <<-G + source "file://#{gem_repo1}" gem "rack", "0.9.1" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1235,6 +1276,60 @@ In Gemfile: R expect(out).to eq(installed_time) end + + it "does reinstall the extension when changing refs", :rubygems => ">= 2.3.0" do + build_git "foo" do |s| + s.add_dependency "rake" + s.extensions << "Rakefile" + s.write "Rakefile", <<-RUBY + task :default do + path = File.expand_path("../lib", __FILE__) + FileUtils.mkdir_p(path) + cur_time = Time.now.to_f.to_s + File.open("\#{path}/foo.rb", "w") do |f| + f.puts "FOO = \#{cur_time}" + end + end + RUBY + end + + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "foo", :git => "#{lib_path("foo-1.0")}" + G + + run! <<-R + require 'foo' + puts FOO + R + + update_git("foo", :branch => "branch2") + + installed_time = out + expect(installed_time).to match(/\A\d+\.\d+\z/) + + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "branch2" + G + + run! <<-R + require 'foo' + puts FOO + R + expect(out).not_to eq(installed_time) + + installed_time = out + + update_git("foo") + bundle! "update foo" + + run! <<-R + require 'foo' + puts FOO + R + expect(out).not_to eq(installed_time) + end end it "ignores git environment variables" do |