module-puppetlabs-mysql/spec/classes/mysql_server_mysqltuner_spec.rb
David Schmitt 6527a3aa22 (MAINT) switch to rspec-puppet-facts
Switching out the puppet version, as puppet_facts does, does not work,
as this will confuse code that wants to use version-dependent features.

Instead this uses rspec-puppet-facts, which doesn't touch the puppet
version.
2015-10-13 11:29:42 +01:00

45 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'mysql::server::mysqltuner' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) {
facts.merge({
:root_home => '/root',
})
}
context 'ensure => present' do
it { is_expected.to compile }
it { is_expected.to contain_staging__file('mysqltuner-v1.3.0').with({
:source => 'https://github.com/major/MySQLTuner-perl/raw/v1.3.0/mysqltuner.pl',
})
}
end
context 'ensure => absent' do
let(:params) {{ :ensure => 'absent' }}
it { is_expected.to compile }
it { is_expected.to contain_file('/usr/local/bin/mysqltuner').with(:ensure => 'absent') }
end
context 'custom version' do
let(:params) {{ :version => 'v1.2.0' }}
it { is_expected.to compile }
it { is_expected.to contain_staging__file('mysqltuner-v1.2.0').with({
:source => 'https://github.com/major/MySQLTuner-perl/raw/v1.2.0/mysqltuner.pl',
})
}
end
context 'custom source' do
let(:params) {{ :source => '/tmp/foo' }}
it { is_expected.to compile }
it { is_expected.to contain_staging__file('mysqltuner-/tmp/foo').with({
:source => '/tmp/foo',
})
}
end
end
end
end