From b77441d4be8735ae13f559d5fca400399eac9f19 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Tue, 5 Jul 2016 16:46:15 +0100 Subject: [PATCH 1/3] Fixing some tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1b48a7e194..a26de6d865 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- language: ruby bundler_args: --without system_tests development -script: "bundle install && bundle exec rake validate && bundle exec rake test SPEC_OPTS='--format documentation'" +script: "bundle install && bundle exec rake validate && bundle exec rake test" cache: bundler sudo: false matrix: From b939f6aa5be62a091f34672b42f57b7dc80a826e Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Tue, 5 Jul 2016 17:04:54 +0100 Subject: [PATCH 2/3] Adding lsbdistrelease fact --- spec/classes/sensu_enterprise_spec.rb | 3 ++- spec/classes/sensu_package_spec.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/classes/sensu_enterprise_spec.rb b/spec/classes/sensu_enterprise_spec.rb index ee1bef4219..9a92112936 100644 --- a/spec/classes/sensu_enterprise_spec.rb +++ b/spec/classes/sensu_enterprise_spec.rb @@ -5,6 +5,7 @@ let(:facts) { { :osfamily => 'RedHat', :fqdn => 'testhost.domain.com' + } } context 'with enterprise => true' do @@ -120,7 +121,7 @@ end context 'on Debian' do - let(:facts) { { :osfamily => 'Debian', :lsbdistid => 'ubuntu' } } + let(:facts) { { :osfamily => 'Debian', :lsbdistid => 'ubuntu', :lsbdistrelease => '14.04', : } } context 'when enterprise => true' do let(:params) { { :enterprise => true, diff --git a/spec/classes/sensu_package_spec.rb b/spec/classes/sensu_package_spec.rb index 4afc250671..02fc7cd70d 100644 --- a/spec/classes/sensu_package_spec.rb +++ b/spec/classes/sensu_package_spec.rb @@ -64,7 +64,7 @@ context 'repos' do context 'ubuntu' do - let(:facts) { { :osfamily => 'Debian' , :lsbdistid => 'ubuntu'} } + let(:facts) { { :osfamily => 'Debian', :lsbdistid => 'ubuntu', :lsbdistrelease => '14.04'} } context 'with puppet-apt installed' do let(:pre_condition) { [ 'define apt::source ($ensure, $location, $release, $repos, $include, $key) {}' ] } From 92ed3c8e5443bd5ff3141e5a3bb41a2b07fe1ad9 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Tue, 5 Jul 2016 17:05:15 +0100 Subject: [PATCH 3/3] Pin JSON Gem version for ruby 1.8.7 --- .travis.yml | 2 +- Gemfile | 3 ++- spec/classes/sensu_enterprise_spec.rb | 2 +- spec/defines/sensu_handler_spec.rb | 5 ++--- spec/defines/sensu_mutator_spec.rb | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index a26de6d865..1b48a7e194 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- language: ruby bundler_args: --without system_tests development -script: "bundle install && bundle exec rake validate && bundle exec rake test" +script: "bundle install && bundle exec rake validate && bundle exec rake test SPEC_OPTS='--format documentation'" cache: bundler sudo: false matrix: diff --git a/Gemfile b/Gemfile index 7c3d0cf6af..a5e35978b8 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ group :development, :unit_tests do gem 'rspec-puppet', :require => false gem 'puppetlabs_spec_helper', :require => false gem 'puppet-lint', "1.0.1", :require => false - gem 'json', :require => false + gem 'json', "~> 1.8.3", :require => false gem 'puppet-syntax', :require => false gem 'metadata-json-lint', :require => false gem 'puppet-blacksmith', :require => false @@ -24,6 +24,7 @@ group :development, :unit_tests do gem 'puppet-lint-undef_in_function-check', :require => false gem 'puppet-lint-unquoted_string-check', :require => false gem 'puppet-lint-version_comparison-check', :require => false + end group :system_tests do diff --git a/spec/classes/sensu_enterprise_spec.rb b/spec/classes/sensu_enterprise_spec.rb index 9a92112936..7fabd81933 100644 --- a/spec/classes/sensu_enterprise_spec.rb +++ b/spec/classes/sensu_enterprise_spec.rb @@ -121,7 +121,7 @@ end context 'on Debian' do - let(:facts) { { :osfamily => 'Debian', :lsbdistid => 'ubuntu', :lsbdistrelease => '14.04', : } } + let(:facts) { { :osfamily => 'Debian', :lsbdistid => 'ubuntu', :lsbdistrelease => '14.04' } } context 'when enterprise => true' do let(:params) { { :enterprise => true, diff --git a/spec/defines/sensu_handler_spec.rb b/spec/defines/sensu_handler_spec.rb index d94a632bae..d742b8593f 100644 --- a/spec/defines/sensu_handler_spec.rb +++ b/spec/defines/sensu_handler_spec.rb @@ -24,7 +24,7 @@ :owner => 'sensu', :group => 'sensu', :mode => '0440' - ).that_comes_before("Sensu_Handler[#{title}]") + ) end end @@ -38,8 +38,7 @@ it { should contain_sensu_handler('myhandler').with_ensure('absent') } it do should contain_file("/etc/sensu/conf.d/handlers/#{title}.json"). - with_ensure('absent'). - that_comes_before("Sensu_Handler[#{title}]") + with_ensure('absent') end end diff --git a/spec/defines/sensu_mutator_spec.rb b/spec/defines/sensu_mutator_spec.rb index c6d2936e10..8a24d26218 100644 --- a/spec/defines/sensu_mutator_spec.rb +++ b/spec/defines/sensu_mutator_spec.rb @@ -20,7 +20,7 @@ :owner => 'sensu', :group => 'sensu', :mode => '0440' - ).that_comes_before("Sensu_Mutator[#{title}]") + ) end end @@ -33,9 +33,9 @@ } } it { should contain_sensu_mutator('mymutator').with_ensure('absent') } it do - should contain_file("/etc/sensu/conf.d/mutators/#{title}.json"). - with_ensure('absent'). - that_comes_before("Sensu_Mutator[#{title}]") + should contain_file("/etc/sensu/conf.d/mutators/#{title}.json").with( + :ensure => 'absent' + ) end end