view modules/mysql/spec/classes/mysql_server_mysqltuner_spec.rb @ 244:48d3a1948e4d

Update MySQL module
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Dec 2019 14:11:43 -0500
parents 58d1818c2ded
children
line wrap: on
line source

require 'spec_helper'

describe 'mysql::server::mysqltuner' do
  context 'ensure => present' do
    it { is_expected.to compile }
    it {
      is_expected.to contain_file('/usr/local/bin/mysqltuner')
    }
  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_file('/usr/local/bin/mysqltuner')
    }
  end

  context 'custom source' do
    let(:params) { { source: '/tmp/foo' } }

    it { is_expected.to compile }
    it {
      is_expected.to contain_file('/usr/local/bin/mysqltuner')
    }
  end
end