summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 16:48:42 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 08:43:50 +0200
commitd35e31d2e067f1d044550705699a979557683a99 (patch)
treec6a13f91b0d992dd2b18d010abe26f1d5bd1454a
parent7844096af05b616d7502e354baf165c1e4edccce (diff)
downloadbundler-d35e31d2e067f1d044550705699a979557683a99.tar.gz
Extract a `tracked_files` path helper
-rw-r--r--spec/quality_spec.rb4
-rw-r--r--spec/support/path.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index cbc58fd4cb..aa59e74662 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -108,7 +108,6 @@ RSpec.describe "The library itself" do
exempt = /\.gitmodules|fixtures|vendor|LICENSE|vcr_cassettes|rbreadline\.diff|\.txt$/
error_messages = []
Dir.chdir(root) do
- tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z`
tracked_files.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_tab_characters(filename)
@@ -122,7 +121,6 @@ RSpec.describe "The library itself" do
exempt = /vendor|vcr_cassettes|LICENSE|rbreadline\.diff/
error_messages = []
Dir.chdir(root) do
- tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z`
tracked_files.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_straneous_quotes(filename)
@@ -135,7 +133,6 @@ RSpec.describe "The library itself" do
exempt = %r{quality_spec.rb|support/helpers|vcr_cassettes|\.md|\.ronn|\.txt|\.5|\.1}
error_messages = []
Dir.chdir(root) do
- tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z`
tracked_files.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_debugging_mechanisms(filename)
@@ -148,7 +145,6 @@ RSpec.describe "The library itself" do
error_messages = []
exempt = %r{lock/lockfile_spec|quality_spec|vcr_cassettes|\.ronn|lockfile_parser\.rb}
Dir.chdir(root) do
- tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z`
tracked_files.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_git_merge_conflicts(filename)
diff --git a/spec/support/path.rb b/spec/support/path.rb
index 133d86e722..70ce645c0a 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -25,6 +25,10 @@ module Spec
@spec_dir ||= root.join(ruby_core? ? "spec/bundler" : "spec")
end
+ def tracked_files
+ @tracked_files ||= ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z`
+ end
+
def tmp(*path)
root.join("tmp", *path)
end