aboutsummaryrefslogtreecommitdiff
path: root/spec/integration
diff options
context:
space:
mode:
authorGheorghe Popescu <gheorghe.popescu@puppet.com>2021-03-12 09:14:24 +0200
committerGitHub <noreply@github.com>2021-03-12 09:14:24 +0200
commitc63ef326bfd2cdd96bbfc3aa368358e301dd7b66 (patch)
tree89d5f38a26cb801ce69ce77a3a8c36cd2eb4541a /spec/integration
parent7c3c42cecb1b864d026404c551374b1d95ee7d95 (diff)
parent9596250a8c0d4263c8ecc7b4c84e4df4ee57b968 (diff)
downloadpuppet-cron_core-c63ef326bfd2cdd96bbfc3aa368358e301dd7b66.tar.gz
puppet-cron_core-c63ef326bfd2cdd96bbfc3aa368358e301dd7b66.tar.bz2
Merge pull request #43 from GabrielNagy/MODULES-10953/update-metadata
Diffstat (limited to 'spec/integration')
-rw-r--r--spec/integration/provider/cron/crontab_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/integration/provider/cron/crontab_spec.rb b/spec/integration/provider/cron/crontab_spec.rb
index 989eae6..a419774 100644
--- a/spec/integration/provider/cron/crontab_spec.rb
+++ b/spec/integration/provider/cron/crontab_spec.rb
@@ -7,17 +7,17 @@ describe Puppet::Type.type(:cron).provider(:crontab), unless: Puppet.features.mi
include PuppetSpec::Compiler
before :each do
- Puppet::Type.type(:cron).stubs(:defaultprovider).returns described_class
- described_class.stubs(:suitable?).returns true
- Puppet::FileBucket::Dipper.any_instance.stubs(:backup) # rubocop:disable RSpec/AnyInstance
+ allow(Puppet::Type.type(:cron)).to receive(:defaultprovider).and_return described_class
+ allow(described_class).to receive(:suitable?).and_return true
+ allow_any_instance_of(Puppet::FileBucket::Dipper).to receive(:backup) # rubocop:disable RSpec/AnyInstance
# I don't want to execute anything
- described_class.stubs(:filetype).returns Puppet::Util::FileType::FileTypeFlat
- described_class.stubs(:default_target).returns crontab_user1
+ allow(described_class).to receive(:filetype).and_return Puppet::Util::FileType::FileTypeFlat
+ allow(described_class).to receive(:default_target).and_return crontab_user1
# I don't want to stub Time.now to get a static header because I don't know
# where Time.now is used elsewhere, so just go with a very simple header
- described_class.stubs(:header).returns "# HEADER: some simple\n# HEADER: header\n"
+ allow(described_class).to receive(:header).and_return "# HEADER: some simple\n# HEADER: header\n"
FileUtils.cp(my_fixture('crontab_user1'), crontab_user1)
FileUtils.cp(my_fixture('crontab_user2'), crontab_user2)
end
@@ -113,9 +113,9 @@ describe Puppet::Type.type(:cron).provider(:crontab), unless: Puppet.features.mi
MANIFEST
apply_compiled_manifest(manifest) do |res|
if res.ref == 'Cron[Entirely new resource]'
- res.expects(:err).with(regexp_matches(%r{no command}))
+ expect(res).to receive(:err).with(%r{no command})
else
- res.expects(:err).never
+ expect(res).not_to receive(:err)
end
end
end