Merge pull request #694 from cmurphy/rspec-puppet-2

Test and future parser updates
This commit is contained in:
Morgan Haskel 2015-03-24 15:53:44 -04:00
commit c05952a398
5 changed files with 24 additions and 10 deletions

View file

@ -1,3 +1,9 @@
---
.travis.yml:
extras:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
spec/spec_helper.rb:
unmanaged: true

View file

@ -1,17 +1,28 @@
---
sudo: false
language: ruby
bundler_args: --without system_tests
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
matrix:
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
notifications:
email: false

View file

@ -1,11 +1,8 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-core', '3.1.7', :require => false
gem 'rspec-puppet', '~> 1.0', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', :require => false
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false

View file

@ -110,7 +110,7 @@ describe 'mysql::server' do
:max_queries_per_hour => nil,
:max_updates_per_hour => nil,
:max_user_connections => nil,
:password_hash => ''
:password_hash => nil
)}
end

View file

@ -16,7 +16,7 @@ describe 'mysql::db', :type => :define do
it 'should report an error when ensure is not present or absent' do
params.merge!({'ensure' => 'invalid_val'})
expect { subject }.to raise_error(Puppet::Error,
expect { catalogue }.to raise_error(Puppet::Error,
/invalid_val is not supported for ensure\. Allowed values are 'present' and 'absent'\./)
end
@ -47,7 +47,7 @@ describe 'mysql::db', :type => :define do
it 'should report an error if sql isn\'t a string or an array' do
params.merge!({'sql' => {'foo' => 'test_sql', 'bar' => 'test_2_sql'}})
expect { subject }.to raise_error(Puppet::Error,
expect { catalogue }.to raise_error(Puppet::Error,
/\$sql must be either a string or an array\./)
end