aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorEnis Inan <enis.inan@puppet.com>2018-11-27 00:55:11 -0800
committerEnis Inan <enis.inan@puppet.com>2018-11-27 01:02:52 -0800
commit51eda1c39f43386ac3b21360c2cc582c31a5c3d3 (patch)
tree7c4b8ff3dee606882577a36c2f4a1452f90fbfdf /spec
parent367acb44cdc8c52227fa5ac9adecc4d9e2d15d32 (diff)
downloadpuppet-cron_core-51eda1c39f43386ac3b21360c2cc582c31a5c3d3.tar.gz
puppet-cron_core-51eda1c39f43386ac3b21360c2cc582c31a5c3d3.tar.bz2
(MODULES-8301) Update the unit tests with the crontab filetype fix
Commit 420049f2 in Puppet fixed the crontab filetype's #read method to use Puppet::Util::Execution.execute instead of %x. This commit updates the unit tests to account for this change.
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/cron/parsed_spec.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/unit/provider/cron/parsed_spec.rb b/spec/unit/provider/cron/parsed_spec.rb
index d4460f7..d913eef 100644
--- a/spec/unit/provider/cron/parsed_spec.rb
+++ b/spec/unit/provider/cron/parsed_spec.rb
@@ -195,12 +195,10 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
end
it 'contains no resources for a user who has no crontab, or for a user that is absent' do
- # `crontab...` does only capture stdout here. On vixie-cron-4.1
- # STDERR shows "no crontab for foobar" but stderr is ignored as
- # well as the exitcode.
- # STDERR shows "crontab: user `foobar' unknown" but stderr is
- # ignored as well as the exitcode
- described_class.target_object('foobar').expects(:`).with('crontab -u foobar -l 2>/dev/null').returns ''
+ Puppet::Util::Execution
+ .expects(:execute)
+ .with('crontab -u foobar -l', failonfail: true, combine: true)
+ .returns('')
expect(described_class.instances.select do |resource|
resource.get('target') == 'foobar'
end).to be_empty