diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-12-01 11:38:43 -0600 |
---|---|---|
committer | Adam Wanninger <ajwann@ajwann.codes> | 2018-01-25 10:01:13 -0500 |
commit | f0e5f9c0e85fd4d1442939bd4517814e655a0c60 (patch) | |
tree | 8e76f9e5bfc044e729b0c150e4bd7c02fac5291c /spec/commands/doctor_spec.rb | |
parent | bc072d8ffb0e9e7a56c309ef872cf71d1858ed42 (diff) | |
download | bundler-f0e5f9c0e85fd4d1442939bd4517814e655a0c60.tar.gz |
[CLI::Doctor] Avoid looping over all files twice
Diffstat (limited to 'spec/commands/doctor_spec.rb')
-rw-r--r-- | spec/commands/doctor_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/commands/doctor_spec.rb b/spec/commands/doctor_spec.rb index 6d2c5ef6a3..ef33bedb57 100644 --- a/spec/commands/doctor_spec.rb +++ b/spec/commands/doctor_spec.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "find" require "stringio" require "bundler/cli" require "bundler/cli/doctor" @@ -68,8 +69,9 @@ RSpec.describe "bundle doctor" do allow(File).to receive(:readable?).with(unwritable_file) { false } expect { doctor.run }.not_to raise_error expect(@stdout.string).to include( - "Files exist in Bundler home that are not readable/writable to the current user. These files are:\n - #{unwritable_file}" + "Files exist in the Bundler home that are not readable/writable to the current user. These files are:\n - #{unwritable_file}" ) + expect(@stdout.string).not_to include("No issues") end it "exits with a warning if home contains files that are read/write but not owned by current user" do @@ -82,7 +84,8 @@ RSpec.describe "bundle doctor" do allow(File).to receive(:readable?).with(unwritable_file) { true } expect { Bundler::CLI::Doctor.new({}).run }.not_to raise_error expect(@stdout.string).to include( - "Files exist in Bundler home that are owned by another user, but are stil readable/writable. These files are:\n - #{unwritable_file}" + "Files exist in the Bundler home that are owned by another user, but are stil readable/writable. These files are:\n - #{unwritable_file}" ) + expect(@stdout.string).not_to include("No issues") end end |