From 96d65f6d51da6b4798c81a717fb1a0d68c4c90e1 Mon Sep 17 00:00:00 2001 From: Jorie Tappa Date: Wed, 1 Aug 2018 11:27:33 -0500 Subject: Fix RSpec/RepeatedExample violations --- spec/unit/provider/cron/parsed_spec.rb | 10 +--------- spec/unit/type/cron_spec.rb | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'spec/unit') diff --git a/spec/unit/provider/cron/parsed_spec.rb b/spec/unit/provider/cron/parsed_spec.rb index 8d6e282..d4460f7 100644 --- a/spec/unit/provider/cron/parsed_spec.rb +++ b/spec/unit/provider/cron/parsed_spec.rb @@ -194,18 +194,10 @@ describe Puppet::Type.type(:cron).provider(:crontab) do Facter.stubs(:value).with(:operatingsystem) end - it 'contains no resources for a user who has no crontab' do + 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. - described_class.target_object('foobar').expects(:`).with('crontab -u foobar -l 2>/dev/null').returns '' - expect(described_class.instances.select do |resource| - resource.get('target') == 'foobar' - end).to be_empty - end - - it 'contains no resources for a user who is absent' do - # `crontab...` does only capture stdout. On vixie-cron-4.1 # 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 '' diff --git a/spec/unit/type/cron_spec.rb b/spec/unit/type/cron_spec.rb index e80ccb9..f60468a 100644 --- a/spec/unit/type/cron_spec.rb +++ b/spec/unit/type/cron_spec.rb @@ -46,7 +46,7 @@ describe Puppet::Type.type(:cron), unless: Puppet.features.microsoft_windows? do end it 'supports absent as a value for ensure' do - expect { described_class.new(name: 'foo', ensure: :present) }.not_to raise_error + expect { described_class.new(name: 'foo', ensure: :absent) }.not_to raise_error end it 'does not support other values' do -- cgit v1.2.3