Update tests for rspec-puppet 2 and future parser
This patch changes the raise_error matchers to use `catalogue` instead of `subject` since `subject` is not evaluated the way it used to be; changes a parameter value from empty string to nil to be compatible with the future parser, and unpins rspec-puppet.
This commit is contained in:
parent
d8b7a9011e
commit
a59c68b165
3 changed files with 3 additions and 4 deletions
1
Gemfile
1
Gemfile
|
@ -3,7 +3,6 @@ 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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue