mariadb_spec.rb 1.11 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
require 'spec_helper'

describe 'nextcloud::mariadb' do
  on_supported_os.each do |os, os_facts|
    context "on #{os}" do
      let(:facts) do
        os_facts.merge(root_home: '/root') # merging custom fact "root_home" is required for mariadb
      end

      let(:pre_condition) do
        "
        class { 'nextcloud':
          db_password       => 'S3cr#TPassw0rdz',
          nc_admin_username => 'ncadmin',
          nc_admin_password => 'ncadminPassword',
          manage_mariadb      => true,
        }
        "
      end

      it { is_expected.to compile }
      it { is_expected.to contain_class('mysql::server') }
      it { is_expected.to contain_class('mysql::client') }
      it { is_expected.to contain_class('mysql::bindings') }
      it { is_expected.to contain_mysql__db('nextcloud') }
      # package_name (mariadb-server) does not seem to be taken in account
      it { is_expected.to contain_package('mysql-server') }
      it { is_expected.to contain_service('mysqld') }
      # it { is_expected.to contain_package('mariadb-server') }
      # it { is_expected.to contain_service('mariadb') }
    end
  end
end