aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelissa Stone <melissa@puppet.com>2018-05-18 10:41:13 -0700
committerMelissa Stone <melissa@puppet.com>2018-05-18 11:14:56 -0700
commit99b8aef830b2eabaf3a217eb08da6deb12e5f8c7 (patch)
tree23ee32cb7a9d5db96013bff3b7c4f6ff4b145804
parentf308ce451412c0569a1c4b726f185fa4cc1a5b3e (diff)
downloadpuppet-mailalias_core-99b8aef830b2eabaf3a217eb08da6deb12e5f8c7.tar.gz
puppet-mailalias_core-99b8aef830b2eabaf3a217eb08da6deb12e5f8c7.tar.bz2
(maint) Mock with rspec not mocha
-rw-r--r--.sync.yml3
-rw-r--r--spec/shared_behaviours/all_parsedfile_providers.rb2
-rw-r--r--spec/spec_helper.rb3
-rw-r--r--spec/unit/type/mailalias_spec.rb4
4 files changed, 9 insertions, 3 deletions
diff --git a/.sync.yml b/.sync.yml
index 367f666..34b1c2f 100644
--- a/.sync.yml
+++ b/.sync.yml
@@ -26,3 +26,6 @@ Gemfile:
Rakefile:
requires:
- puppet-lint/tasks/puppet-lint
+
+spec/spec_helper.rb:
+ mock_with: ':rspec'
diff --git a/spec/shared_behaviours/all_parsedfile_providers.rb b/spec/shared_behaviours/all_parsedfile_providers.rb
index d697a14..1701fe3 100644
--- a/spec/shared_behaviours/all_parsedfile_providers.rb
+++ b/spec/shared_behaviours/all_parsedfile_providers.rb
@@ -5,7 +5,7 @@ shared_examples_for 'all parsedfile providers' do |provider, *files|
files.flatten.each do |file|
it "should rewrite #{file} reasonably unchanged" do
- provider.stubs(:default_target).returns(file)
+ allow(provider).to receive(:default_target).and_return(file)
provider.prefetch
text = provider.to_file(provider.target_records(file))
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e117192..b71d71e 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,6 @@
+RSpec.configure do |c|
+ c.mock_with :rspec
+end
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
diff --git a/spec/unit/type/mailalias_spec.rb b/spec/unit/type/mailalias_spec.rb
index 1fb195e..80b838c 100644
--- a/spec/unit/type/mailalias_spec.rb
+++ b/spec/unit/type/mailalias_spec.rb
@@ -29,13 +29,13 @@ describe Puppet::Type.type(:mailalias) do
it 'tries and set the recipient when it does the sync' do
expect(recipient_resource.retrieve_resource[:recipient]).to eq(:absent)
- recipient_resource.property(:recipient).expects(:set).with(['yay'])
+ expect(recipient_resource.property(:recipient)).to receive(:set).with(['yay'])
recipient_resource.property(:recipient).sync
end
it 'tries and set the included file when it does the sync' do
expect(file_resource.retrieve_resource[:file]).to eq(:absent)
- file_resource.property(:file).expects(:set).with(tmpfile_path)
+ expect(file_resource.property(:file)).to receive(:set).with(tmpfile_path)
file_resource.property(:file).sync
end