Skip to content

Commit

Permalink
Workaround the broken rspec-mocks support in rspec-puppet
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidS committed Jun 1, 2015
1 parent 080d163 commit 65b56c7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module PuppetSpec
require 'monkey_patches/alias_should_to_must'
require 'mocha/api'

# hack to enable all the expect syntax (like allow_any_instance_of) in rspec-puppet examples
RSpec::Mocks::Syntax.enable_expect(RSpec::Puppet::ManifestMatchers)

RSpec.configure do |config|
config.before :each do
# Ensure that we don't accidentally cache facts and environment between
Expand All @@ -29,5 +32,12 @@ module PuppetSpec
Facter.clear_messages

Puppet[:parser] = 'future' if ENV['FUTURE_PARSER'] == 'yes'

RSpec::Mocks.setup
end

config.after :each do
RSpec::Mocks.verify
RSpec::Mocks.teardown
end
end

0 comments on commit 65b56c7

Please sign in to comment.