Skip to content

Commit

Permalink
Update tests for rspec-puppet 2 and future parser
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Colleen Murphy committed Mar 24, 2015
1 parent d8b7a90 commit a59c68b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/mysql_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
:max_queries_per_hour => nil,
:max_updates_per_hour => nil,
:max_user_connections => nil,
:password_hash => ''
:password_hash => nil
)}
end

Expand Down
4 changes: 2 additions & 2 deletions spec/defines/mysql_db_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

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

Expand Down Expand Up @@ -47,7 +47,7 @@

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

Expand Down

0 comments on commit a59c68b

Please sign in to comment.