Skip to content

Commit 0222b18

Browse files
committed
(maint) Switch to rspec-mocks
1 parent 69eed23 commit 0222b18

File tree

5 files changed

+85
-92
lines changed

5 files changed

+85
-92
lines changed

spec/lib/puppet_spec/compiler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def apply_compiled_manifest(manifest, prioritizer = Puppet::Graph::SequentialPri
1919
if Puppet.version.to_f < 5.0
2020
args << 'apply'
2121
# rubocop:disable RSpec/AnyInstance
22-
Puppet::Transaction::Persistence.any_instance.stubs(:save)
22+
allow_any_instance_of(Puppet::Transaction::Persistence).to receive(:save)
2323
# rubocop:enable RSpec/AnyInstance
2424
end
2525
catalog = compile_to_ral(manifest)
@@ -37,7 +37,7 @@ def apply_compiled_manifest(manifest, prioritizer = Puppet::Graph::SequentialPri
3737

3838
def apply_with_error_check(manifest)
3939
apply_compiled_manifest(manifest) do |res|
40-
res.expects(:err).never
40+
expect(res).not_to receive(:err)
4141
end
4242
end
4343
end

spec/lib/puppet_spec/files.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def self.cleanup
1111
until @global_tempfiles.empty?
1212
path = @global_tempfiles.pop
1313
begin
14-
Dir.unstub(:entries)
14+
allow(Dir).to receive(:entries).and_call_original
1515
FileUtils.rm_rf path, secure: true
1616
end
1717
end

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
end
3232

3333
RSpec.configure do |c|
34+
c.mock_with :rspec
3435
c.default_facts = default_facts
3536
c.before :each do
3637
# set to strictest setting for testing

0 commit comments

Comments
 (0)