Merge "Add rspec-puppet-facts to the spec_helper"

This commit is contained in:
Jenkins 2016-01-14 20:18:05 +00:00 committed by Gerrit Code Review
commit 3dcf1cb6c5
2 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :development, :test do group :development, :test do
gem 'puppetlabs_spec_helper', :require => 'false' gem 'puppetlabs_spec_helper', :require => 'false'
gem 'rspec-puppet', '~> 2.2.0', :require => 'false' gem 'rspec-puppet', '~> 2.2.0', :require => 'false'
gem 'rspec-puppet-facts', :require => 'false'
gem 'metadata-json-lint', :require => 'false' gem 'metadata-json-lint', :require => 'false'
gem 'puppet-lint-param-docs', :require => 'false' gem 'puppet-lint-param-docs', :require => 'false'
gem 'puppet-lint-absolute_classname-check', :require => 'false' gem 'puppet-lint-absolute_classname-check', :require => 'false'
@ -14,6 +15,9 @@ group :development, :test do
gem 'puppet-lint-numericvariable', :require => 'false' gem 'puppet-lint-numericvariable', :require => 'false'
gem 'json', :require => 'false' gem 'json', :require => 'false'
gem 'webmock', :require => 'false' gem 'webmock', :require => 'false'
gem 'puppet-openstack_spec_helper',
:git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper',
:require => false
end end
group :system_tests do group :system_tests do

View File

@ -2,9 +2,18 @@ require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples' require 'shared_examples'
require 'webmock/rspec' require 'webmock/rspec'
require 'puppet-openstack_spec_helper/defaults'
require 'rspec-puppet-facts'
include RspecPuppetFacts
RSpec.configure do |c| RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures' c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises' c.alias_it_should_behave_like_to :it_raises, 'raises'
# TODO(aschultz): remove this after all tests converted to use OSDefaults
# instead of referencing @default_facts
c.before :each do
@default_facts = OSDefaults.get_facts
end
end end
at_exit { RSpec::Puppet::Coverage.report! } at_exit { RSpec::Puppet::Coverage.report! }