aboutsummaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGabriel Nagy <gabriel.nagy@puppet.com>2021-03-11 14:17:09 +0200
committerGabriel Nagy <gabriel.nagy@puppet.com>2021-03-11 14:37:19 +0200
commit51ebf2d8d5c02c7cd314edd9e6507163a8073785 (patch)
tree5d48c36b51fcf8116d4a4160a764f09e4abeb92c /spec/lib
parent7c3c42cecb1b864d026404c551374b1d95ee7d95 (diff)
downloadpuppet-cron_core-51ebf2d8d5c02c7cd314edd9e6507163a8073785.tar.gz
puppet-cron_core-51ebf2d8d5c02c7cd314edd9e6507163a8073785.tar.bz2
(maint) Switch to rspec-mocks
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/puppet_spec/compiler.rb4
-rw-r--r--spec/lib/puppet_spec/files.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/lib/puppet_spec/compiler.rb b/spec/lib/puppet_spec/compiler.rb
index fb04a7b..44274bf 100644
--- a/spec/lib/puppet_spec/compiler.rb
+++ b/spec/lib/puppet_spec/compiler.rb
@@ -33,7 +33,7 @@ module PuppetSpec::Compiler
if Puppet.version.to_f < 5.0
args << 'apply'
# rubocop:disable RSpec/AnyInstance
- Puppet::Transaction::Persistence.any_instance.stubs(:save)
+ allow_any_instance_of(Puppet::Transaction::Persistence).to receive(:save)
# rubocop:enable RSpec/AnyInstance
end
catalog = compile_to_ral(manifest)
@@ -51,7 +51,7 @@ module PuppetSpec::Compiler
def apply_with_error_check(manifest)
apply_compiled_manifest(manifest) do |res|
- res.expects(:err).never
+ expect(res).not_to receive(:err)
end
end
diff --git a/spec/lib/puppet_spec/files.rb b/spec/lib/puppet_spec/files.rb
index c8315c9..af0e936 100644
--- a/spec/lib/puppet_spec/files.rb
+++ b/spec/lib/puppet_spec/files.rb
@@ -10,7 +10,7 @@ module PuppetSpec::Files
$global_tempfiles ||= []
$global_tempfiles.each do |path|
begin
- Dir.unstub(:entries)
+ allow(Dir).to receive(:entries).and_call_original
FileUtils.rm_rf path, secure: true
rescue Errno::ENOENT # rubocop:disable Lint/HandleExceptions
# nothing to do