summaryrefslogtreecommitdiff
path: root/spec/support/chef_helpers.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-11-16 16:28:49 -0800
committerdanielsdeleo <dan@opscode.com>2012-11-19 14:05:15 -0800
commitd068ae1842ee1690db21c92654d51e0959cda8b4 (patch)
tree6d05d897e7163a932ffdce6c32b56467f693c860 /spec/support/chef_helpers.rb
parent9b39d2ca14733fe082fcd6e05d6c928219726d07 (diff)
downloadchef-d068ae1842ee1690db21c92654d51e0959cda8b4.tar.gz
fixes binmode issues on windows
Diffstat (limited to 'spec/support/chef_helpers.rb')
-rw-r--r--spec/support/chef_helpers.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb
index 77f5fc7669..77cbe5b5cb 100644
--- a/spec/support/chef_helpers.rb
+++ b/spec/support/chef_helpers.rb
@@ -50,3 +50,16 @@ def make_tmpname(prefix_suffix, n)
path << "-#{n}" if n
path << suffix
end
+
+# NOTE:
+# This is a temporary fix to get tests passing on systems that have no `diff`
+# until we can replace shelling out to `diff` with ruby diff-lcs
+def has_diff?
+ begin
+ diff_cmd = Mixlib::ShellOut.new("diff -v")
+ diff_cmd.run_command
+ true
+ rescue Errno::ENOENT
+ false
+ end
+end