From 493f0cbc1c96a3fa67591f3936430a70af74847f Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Mon, 24 Oct 2022 22:04:43 +0100 Subject: [PATCH] (CONT-237) - Set rspec as default for mock_with --- lib/puppetlabs_spec_helper/puppet_spec_helper.rb | 10 +--------- spec/spec_helper.rb | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/puppetlabs_spec_helper/puppet_spec_helper.rb b/lib/puppetlabs_spec_helper/puppet_spec_helper.rb index bc9ea07f..7a45395a 100644 --- a/lib/puppetlabs_spec_helper/puppet_spec_helper.rb +++ b/lib/puppetlabs_spec_helper/puppet_spec_helper.rb @@ -135,15 +135,7 @@ def handle(msg) # `mock_framework`'s autoloading to distinguish between the default, and # the module's choice. if config.instance_variable_get(:@mock_framework).nil? - RSpec.warn_deprecation('puppetlabs_spec_helper: defaults `mock_with` to `:mocha`. See https://github.com/puppetlabs/puppetlabs_spec_helper#mock_with to choose a sensible value for you') - config.mock_with :mocha - end - - # determine whether we can use the new API or not, and call the appropriate initializer method. - if defined?(Puppet::Test::TestHelper) - # This case is handled by rspec-puppet since v1.0.0 (via 41257b33cb1f9ade4426b044f70be511b0c89112) - else - Puppet::PuppetSpecInitializer.initialize_via_fallback_compatibility(config) + config.mock_with :rspec end # Here we do some general setup that is relevant to all initialization modes, regardless diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1b31959f..c0f859c0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -48,7 +48,6 @@ def symlink? config.expect_with :rspec do |c| c.syntax = :expect end - config.mock_with :rspec config.include_context 'with a rake task', type: :task end