Skip to content

Commit

Permalink
(CONT-237) - Set rspec as default for mock_with
Browse files Browse the repository at this point in the history
  • Loading branch information
chelnak committed Oct 24, 2022
1 parent ae11109 commit 493f0cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 1 addition & 9 deletions lib/puppetlabs_spec_helper/puppet_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 493f0cb

Please sign in to comment.