summaryrefslogtreecommitdiff
path: root/spec/unit/util/diff_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-04-24(PUP-2073) fix for multiple diff_argsMatt Shean1-0/+8
Previously, if you specified multiple arguments in the `diff_args` setting, they would be considered a single argument and quoted to the diff command. Puppet would then try to execute: diff '-u --strip-trailing-cr' pathA pathB But would silently fail without showing any diffs. This commit ensures we can handle multiple diff args.
2012-11-15(#17007) Make failonfail and combine explicitJosh Cooper1-2/+2
Previously, many providers called Puppet::Util.execute with an argument(s), which had the side-effect of defaulting failonfail and combine to false. This commit does not change any behavior. Instead in places where execute is called with arguments, it explicitly sets failonfail and/or combine to false. This way it's less confusing as to what the provider is doing.
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune1-1/+1
Without this patch Ruby 1.9 is still complaining loudly about trying to parse the spec files. The previous attempt to clean up this problem in edc3ddf works for Ruby 1.8 but not 1.9. I'd prefer to remove the shebang lines entirely, but doing so will cause encoding errors in Ruby 1.9. This patch strives for a happy middle ground of convincing Ruby it is actually working with Ruby while not confusing it to think it should exec() to rspec. This patch is the result of the following command run against the source tree: find spec -type f -print0 | \ xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
2012-06-29Fix spec test failures from diff warningJeff McCune1-4/+5
I was bad and made a change to the execution behavior of diff without bothering to update the spec tests. This patch fixes the failing spec tests to match the new expectation that Puppet::Util::Execution.execute is used instead of Puppet::Util::Diff#execute as was previously used.
2012-01-23(#10417) Disable `diff` on Windows by defaultJosh Cooper1-0/+30
Previously, anyone running `puppet apply` or `puppet agent` with either the `--test`, `--noop`, or `--show_diffs` option, would see a `CreateProcess` exception while trying to execute the `diff` command. This was made worse by the recent change that causes puppet to diff its last run summary file. On Windows, diff is not present, by default. There is fc.exe (file compare), but it is rather brain-dead, especially if you diff a binary file. This commit makes `Puppet::Util::Diff.diff` return '' by default on Windows. However, if a diff command has been specified in puppet.conf, then puppet will use it, as before.