summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-05-26 11:15:03 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-06-14 10:15:47 -0500
commite274d9fe47a0f1801761e4646ce5df32df6033ac (patch)
tree7a923fa48f962c769d512046d0bae34098b23741 /spec/commands
parentddcca6254cc4e63cbb25b78f8ec93462fa56249c (diff)
downloadbundler-e274d9fe47a0f1801761e4646ce5df32df6033ac.tar.gz
[Pristine] Ensure git gems have added files removed
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/pristine_spec.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb
index cc01aabbf7..2bf9d46c66 100644
--- a/spec/commands/pristine_spec.rb
+++ b/spec/commands/pristine_spec.rb
@@ -52,12 +52,23 @@ RSpec.describe "bundle pristine" do
changed_file = Pathname.new(spec.full_gem_path).join("lib/foo.rb")
diff = "#Pristine spec changes"
- File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" }
+ File.open(changed_file, "a") {|f| f.puts diff }
expect(File.read(changed_file)).to include(diff)
- bundle "pristine"
+ bundle! "pristine"
expect(File.read(changed_file)).to_not include(diff)
end
+
+ it "removes added files" do
+ spec = Bundler.definition.specs["foo"].first
+ 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).not_to be_file
+ end
end
context "when sourced from gemspec" do
@@ -66,7 +77,7 @@ RSpec.describe "bundle pristine" do
changed_file = Pathname.new(spec.full_gem_path).join("lib/baz.rb")
diff = "#Pristine spec changes"
- File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" }
+ File.open(changed_file, "a") {|f| f.puts diff }
expect(File.read(changed_file)).to include(diff)
bundle "pristine"