diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-08 14:19:04 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-13 07:54:37 +0900 |
commit | 0e60b59d5884edb8f9aea023efd9b24f1ff02049 (patch) | |
tree | e52935ce510440872ca5ce6b0e092cbc94f18bc9 /spec/bundler/commands/pristine_spec.rb | |
parent | 68224651a4d4dc3ce0cea666f5423dd8b6ba6cfc (diff) | |
download | ruby-0e60b59d5884edb8f9aea023efd9b24f1ff02049.tar.gz |
Update the bundler version with master branch
Diffstat (limited to 'spec/bundler/commands/pristine_spec.rb')
-rw-r--r-- | spec/bundler/commands/pristine_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/bundler/commands/pristine_spec.rb b/spec/bundler/commands/pristine_spec.rb index cc7f760d74..15336137b6 100644 --- a/spec/bundler/commands/pristine_spec.rb +++ b/spec/bundler/commands/pristine_spec.rb @@ -22,12 +22,14 @@ RSpec.describe "bundle pristine", :ruby_repo do source "#{file_uri_for(gem_repo2)}" gem "weakling" gem "very_simple_binary" - gem "foo", :git => "#{lib_path("foo")}" + gem "foo", :git => "#{lib_path("foo")}", :branch => "master" gem "git_with_ext", :git => "#{lib_path("git_with_ext")}" gem "bar", :path => "#{lib_path("bar")}" gemspec G + + allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) end context "when sourced from RubyGems" do @@ -81,6 +83,19 @@ RSpec.describe "bundle pristine", :ruby_repo do bundle! "pristine" expect(changes_txt).not_to be_file end + + it "displays warning and ignores changes when a local config exists" do + spec = Bundler.definition.specs["foo"].first + bundle "config set local.#{spec.name} #{lib_path(spec.name)}" + + changes_txt = Pathname.new(spec.full_gem_path).join("lib/changes.txt") + FileUtils.touch(changes_txt) + expect(changes_txt).to be_file + + bundle "pristine" + expect(changes_txt).to be_file + expect(err).to include("Cannot pristine #{spec.name} (#{spec.version}#{spec.git_version}). Gem is locally overriden.") + end end context "when sourced from gemspec" do |