summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-06-23 14:09:08 -0700
committerGitHub <noreply@github.com>2020-06-23 14:09:08 -0700
commit70efe2b6766846ff913461fe7da35bed2b98ce4f (patch)
tree88c58f2ebfb621ff34f0ee3fd7fb2b0ac8c2869d
parentcb79fb33208efe059a49871192c94bcfded481ab (diff)
parent7069955cd1964a805faed26c3035fd3e43b23d1d (diff)
downloadchef-70efe2b6766846ff913461fe7da35bed2b98ce4f.tar.gz
Merge pull request #10052 from chef/fix-diff-tests
Fix broken tests after updating diff-lcs dep
-rw-r--r--spec/unit/chef_fs/diff_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/unit/chef_fs/diff_spec.rb b/spec/unit/chef_fs/diff_spec.rb
index 27374b357b..29c25e2823 100644
--- a/spec/unit/chef_fs/diff_spec.rb
+++ b/spec/unit/chef_fs/diff_spec.rb
@@ -23,9 +23,10 @@ require "chef/chef_fs/command_line"
# Removes the date stamp from the diff and replaces it with ' DATE'
# example match: "/dev/null\t2012-10-16 16:15:54.000000000 +0000"
# windows match: "--- /dev/null\tTue Oct 16 18:04:34 2012"
+# https://rubular.com/r/5JdtZDqWnZhB9J
def remove_os_differences(diff)
diff = diff.gsub(/([+-]{3}.*)\t.*/, '\1 DATE')
- diff.gsub(/^@@ -\d(,\d)? \+\d(,\d)? @@/, "CONTEXT_LINE_NUMBERS")
+ diff.gsub(/^@@ -\d(,\d)? \+-?\d(,-?\d)? @@/, "CONTEXT_LINE_NUMBERS")
end
describe "diff", uses_diff: true do