module-puppetlabs-mysql/spec/acceptance/mysql_account_delete_spec.rb
Hunter Haugen 0aed9e07f7 Adding beaker-rspec test files
These tests are more or less parity with the rspec-system tests, though
dependent on a few patches that still have to make it into beaker and
beaker-rspec
2013-12-06 14:52:41 -08:00

25 lines
755 B
Ruby

require 'spec_helper_acceptance'
describe 'mysql::server::account_security class' do
describe 'running puppet code' do
it 'should work with no errors' do
pp = <<-EOS
class { 'mysql::server': remove_default_accounts => true }
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
end
describe 'accounts' do
it 'should delete accounts' do
shell("mysql -e 'show grants for root@127.0.0.1;'", :acceptable_exit_codes => 1)
end
it 'should delete databases' do
shell("mysql -e 'show databases;' |grep test", :acceptable_exit_codes => 1)
end
end
end
end