Initial commit
This commit is contained in:
23
spec/classes/config_spec.rb
Normal file
23
spec/classes/config_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
require 'spec_helper'
|
||||
describe 'dokuwiki::config' do
|
||||
|
||||
context 'with defaults for all parameters' do
|
||||
let(:params) {{
|
||||
:manage_vhost => true,
|
||||
:vhost => 'dokuwiki.example.com',
|
||||
:base_path => 'dokuwiki',
|
||||
:apache_confdir => '/etc/apache2/vhosts.d',
|
||||
:install_dir => '/var/www/localhost/htdocs',
|
||||
:local_conf_template => 'dokuwiki/local.php.erb',
|
||||
:protected_conf_template => 'dokuwiki/local.protected.php.erb',
|
||||
:ldap_servers => ['ldap'],
|
||||
}}
|
||||
|
||||
it { should contain_file('/var/www/localhost/htdocs/dokuwiki/conf/local.php') }
|
||||
it {
|
||||
should contain_file('/var/www/localhost/htdocs/dokuwiki/conf/local.protected.php')
|
||||
.with_content(/Managed by puppet/)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
23
spec/classes/init_spec.rb
Normal file
23
spec/classes/init_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
require 'spec_helper'
|
||||
describe 'dokuwiki' do
|
||||
|
||||
context 'on unsupported distributions' do
|
||||
let(:facts) {{
|
||||
:osfamily => 'Unsupported',
|
||||
}}
|
||||
|
||||
it 'we fail' do
|
||||
expect { subject }.to raise_error(/not supported on an Unsupported/)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with defaults for all parameters' do
|
||||
let(:facts) {{
|
||||
:osfamily => 'Gentoo',
|
||||
}}
|
||||
|
||||
it { should contain_class('dokuwiki') }
|
||||
it { should contain_class('dokuwiki::install') }
|
||||
it { should contain_class('dokuwiki::config') }
|
||||
end
|
||||
end
|
||||
17
spec/classes/install_spec.rb
Normal file
17
spec/classes/install_spec.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
require 'spec_helper'
|
||||
describe 'dokuwiki::install' do
|
||||
|
||||
context 'with defaults for all parameters' do
|
||||
it { should contain_package('www-apps/dokuwiki') }
|
||||
end
|
||||
|
||||
context 'on Gentoo' do
|
||||
let(:params) {{
|
||||
:use_webapp_config => true,
|
||||
:version => '123'
|
||||
}}
|
||||
|
||||
it { should contain_webapp_config('dokuwiki-123') }
|
||||
end
|
||||
end
|
||||
|
||||
2
spec/spec_helper.rb
Normal file
2
spec/spec_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
require 'puppetlabs_spec_helper/module_spec_helper'
|
||||
require 'hiera'
|
||||
Reference in New Issue
Block a user