Merge pull request #822 from jfryman/fix-tests

Fix tests
This commit is contained in:
Matthew Haughton 2016-06-22 23:04:34 -04:00 committed by GitHub
commit a4cee014be
4 changed files with 18 additions and 21 deletions

View file

@ -7,7 +7,7 @@ sudo: false
language: ruby language: ruby
cache: bundler cache: bundler
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'" script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
bundler_args: --without rake bundler_args: --without system_tests
matrix: matrix:
fast_finish: true fast_finish: true
include: include:

24
Gemfile
View file

@ -1,20 +1,16 @@
source 'https://rubygems.org' source 'https://rubygems.org'
group :test do
gem 'rest-client', '~> 1.6.8', :require => false, :platforms => :ruby_18
end
group :rake, :test do
gem 'puppetlabs_spec_helper', '>=0.8.2', :require => false
gem 'puppet-blacksmith', :require => false
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
end
group :rake do group :rake do
gem 'rspec-puppet', '>=2.1.0', :require => false gem 'puppetlabs_spec_helper', '~> 1.1', :require => false
gem 'rake', '>=0.9.2.2' gem 'rspec-puppet', '~> 2.3', :require => false
gem 'puppet-lint', '>=1.0.1' gem 'puppet-lint', '~> 2.0', :require => false
gem 'puppet-blacksmith', :require => false
gem 'rake', :require => false
end
group :system_tests do
gem 'beaker-rspec', :require => false
gem 'beaker', :require => false
end end
if puppetversion = ENV['PUPPET_GEM_VERSION'] if puppetversion = ENV['PUPPET_GEM_VERSION']

View file

@ -12,8 +12,9 @@ task :default => [:clean, :spec]
PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative') PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_class_parameter_defaults')
PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables') PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]

View file

@ -21,11 +21,11 @@ describe 'nginx' do
it { is_expected.to compile.with_all_deps } it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('nginx') } it { is_expected.to contain_class('nginx') }
it { is_expected.to contain_anchor('nginx::begin') } it { is_expected.to contain_anchor('nginx::begin') }
it { is_expected.to contain_nginx__package.that_requires('Anchor[nginx::begin]') } it { is_expected.to contain_class('nginx::package').that_requires('Anchor[nginx::begin]') }
it { is_expected.to contain_nginx__config.that_requires('Class[nginx::package]') } it { is_expected.to contain_class('nginx::config').that_requires('Class[nginx::package]') }
it { is_expected.to contain_nginx__service.that_subscribes_to('Anchor[nginx::begin]') } it { is_expected.to contain_class('nginx::service').that_subscribes_to('Anchor[nginx::begin]') }
it { is_expected.to contain_nginx__service.that_subscribes_to('Class[nginx::package]') } it { is_expected.to contain_class('nginx::service').that_subscribes_to('Class[nginx::package]') }
it { is_expected.to contain_nginx__service.that_subscribes_to('Class[nginx::config]') } it { is_expected.to contain_class('nginx::service').that_subscribes_to('Class[nginx::config]') }
it { is_expected.to contain_anchor('nginx::end').that_requires('Class[nginx::service]') } it { is_expected.to contain_anchor('nginx::end').that_requires('Class[nginx::service]') }
it { is_expected.to contain_nginx__resource__upstream("upstream1") } it { is_expected.to contain_nginx__resource__upstream("upstream1") }
it { is_expected.to contain_nginx__resource__vhost("test2.local") } it { is_expected.to contain_nginx__resource__vhost("test2.local") }