aboutsummaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/provider/cron/crontab_spec.rb4
-rw-r--r--spec/unit/provider/cron/parsed_spec.rb8
-rw-r--r--spec/unit/type/cron_spec.rb12
3 files changed, 12 insertions, 12 deletions
diff --git a/spec/unit/provider/cron/crontab_spec.rb b/spec/unit/provider/cron/crontab_spec.rb
index 6e28393..4047f82 100644
--- a/spec/unit/provider/cron/crontab_spec.rb
+++ b/spec/unit/provider/cron/crontab_spec.rb
@@ -37,11 +37,11 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
samples = YAML.load(File.read(my_fixture('single_line.yaml'))) # rubocop:disable Security/YAMLLoad
samples.each do |name, data|
- it "should parse crontab line #{name} correctly" do
+ it "parses crontab line #{name} correctly" do
compare_crontab_record subject.parse_line(data[:text]), data[:record]
end
- it "should reconstruct the crontab line #{name} from the record" do
+ it "reconstructs the crontab line #{name} from the record" do
expect(subject.to_line(data[:record])).to eq(data[:text])
end
end
diff --git a/spec/unit/provider/cron/parsed_spec.rb b/spec/unit/provider/cron/parsed_spec.rb
index e4fa4cd..8e02ce6 100644
--- a/spec/unit/provider/cron/parsed_spec.rb
+++ b/spec/unit/provider/cron/parsed_spec.rb
@@ -81,7 +81,7 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
# I'd use expect(ENV).to receive(:[]).with('USER') but this does not work because
# ENV["USER"] is evaluated at load time.
describe 'when determining the default target' do
- it "should use the current user #{ENV['USER']}", if: ENV['USER'] do
+ it "uses the current user #{ENV['USER']}", if: ENV['USER'] do
expect(described_class.default_target).to eq(ENV['USER'])
end
@@ -166,7 +166,7 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
describe 'it should support special strings' do
['reboot', 'yearly', 'anually', 'monthly', 'weekly', 'daily', 'midnight', 'hourly'].each do |special|
- it "should support @#{special}" do
+ it "supports @#{special}" do
expect(described_class.parse_line("@#{special} /bin/true")).to eq(record_type: :crontab,
hour: :absent,
minute: :absent,
@@ -300,7 +300,7 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
command: '/bin/false',
target: 'nobody',
}.each_pair do |field, new_value|
- it "should not match a record when #{field} does not match" do
+ it "does not match a record when #{field} does not match" do
record[field] = new_value
expect(described_class.match(record, resource[:name] => resource)).to be_falsey
end
@@ -317,7 +317,7 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
command: '/bin/false',
target: 'root',
}.each_pair do |field, new_value|
- it "should not match a record when #{field} does not match" do
+ it "does not match a record when #{field} does not match" do
record_special[field] = new_value
expect(described_class.match(record_special, resource_special[:name] => resource_special)).to be_falsey
end
diff --git a/spec/unit/type/cron_spec.rb b/spec/unit/type/cron_spec.rb
index 78deabf..9564d16 100644
--- a/spec/unit/type/cron_spec.rb
+++ b/spec/unit/type/cron_spec.rb
@@ -21,19 +21,19 @@ describe Puppet::Type.type(:cron), unless: Puppet.features.microsoft_windows? do
describe 'when validating attributes' do
[:name, :provider].each do |param|
- it "should have a #{param} parameter" do
+ it "has a #{param} parameter" do
expect(described_class.attrtype(param)).to eq(:param)
end
end
[:command, :special, :minute, :hour, :weekday, :month, :monthday, :environment, :user, :target].each do |property|
- it "should have a #{property} property" do
+ it "has a #{property} property" do
expect(described_class.attrtype(property)).to eq(:property)
end
end
[:command, :minute, :hour, :weekday, :month, :monthday].each do |cronparam|
- it "should have #{cronparam} of type CronParam" do
+ it "has #{cronparam} of type CronParam" do
expect(described_class.attrclass(cronparam).ancestors).to include CronParam
end
end
@@ -490,7 +490,7 @@ describe Puppet::Type.type(:cron), unless: Puppet.features.microsoft_windows? do
describe 'special' do
['reboot', 'yearly', 'annually', 'monthly', 'weekly', 'daily', 'midnight', 'hourly'].each do |value|
- it "should support the value '#{value}'" do
+ it "supports the value '#{value}'" do
expect { described_class.new(name: 'foo', special: value) }.not_to raise_error
end
end
@@ -498,7 +498,7 @@ describe Puppet::Type.type(:cron), unless: Puppet.features.microsoft_windows? do
context 'when combined with numeric schedule fields' do
context "which are 'absent'" do
[['reboot', 'yearly', 'annually', 'monthly', 'weekly', 'daily', 'midnight', 'hourly'], :absent].flatten.each do |value|
- it "should accept the value '#{value}' for special" do
+ it "accepts the value '#{value}' for special" do
expect {
described_class.new(name: 'foo', minute: :absent, special: value)
}.not_to raise_error
@@ -507,7 +507,7 @@ describe Puppet::Type.type(:cron), unless: Puppet.features.microsoft_windows? do
end
context 'which are not absent' do
['reboot', 'yearly', 'annually', 'monthly', 'weekly', 'daily', 'midnight', 'hourly'].each do |value|
- it "should not accept the value '#{value}' for special" do
+ it "does not accept the value '#{value}' for special" do
expect {
described_class.new(name: 'foo', minute: '1', special: value)
}.to raise_error(Puppet::Error, %r{cannot specify both a special schedule and a value})