2018-01-26 14:05:22 +00:00
|
|
|
if ENV['COVERAGE'] == 'yes'
|
|
|
|
require 'simplecov'
|
|
|
|
require 'simplecov-console'
|
|
|
|
require 'codecov'
|
|
|
|
|
|
|
|
SimpleCov.formatters = [
|
|
|
|
SimpleCov::Formatter::HTMLFormatter,
|
|
|
|
SimpleCov::Formatter::Console,
|
|
|
|
SimpleCov::Formatter::Codecov,
|
|
|
|
]
|
|
|
|
SimpleCov.start do
|
|
|
|
track_files 'lib/**/*.rb'
|
|
|
|
|
|
|
|
add_filter '/spec'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-16 04:08:35 +00:00
|
|
|
require 'mocha'
|
|
|
|
require 'rspec'
|
2016-09-16 19:15:26 +00:00
|
|
|
require 'puppet/version'
|
2016-09-09 20:44:05 +00:00
|
|
|
require 'puppet-strings'
|
2018-01-23 00:22:42 +00:00
|
|
|
require 'puppet-strings/markdown'
|
|
|
|
require 'puppet-strings/markdown/base'
|
2016-09-14 19:20:26 +00:00
|
|
|
require 'puppet-strings/yard'
|
|
|
|
|
|
|
|
# Explicitly set up YARD once
|
|
|
|
PuppetStrings::Yard.setup!
|
2014-08-26 23:57:55 +00:00
|
|
|
|
2016-09-16 19:15:26 +00:00
|
|
|
# Enable testing of Puppet functions if running against 4.1+
|
|
|
|
TEST_PUPPET_FUNCTIONS = Gem::Dependency.new('', '>= 4.1.0').match?('', Puppet::PUPPETVERSION)
|
|
|
|
|
2016-11-11 20:33:02 +00:00
|
|
|
# Enable testing of Puppet language functions declared with return type if running against 4.8+
|
|
|
|
TEST_FUNCTION_RETURN_TYPE = Gem::Dependency.new('', '>= 4.8.0').match?('', Puppet::PUPPETVERSION)
|
|
|
|
|
2014-08-19 17:44:40 +00:00
|
|
|
RSpec.configure do |config|
|
2016-09-14 19:20:26 +00:00
|
|
|
config.mock_with :mocha
|
|
|
|
|
|
|
|
config.before(:each) do
|
|
|
|
# Always clear the YARD registry before each example
|
|
|
|
YARD::Registry.clear
|
|
|
|
end
|
2014-05-16 04:08:35 +00:00
|
|
|
end
|