diff --git a/spec/classes/apache_spec.rb b/spec/classes/apache_spec.rb deleted file mode 100644 index b3a6d00..0000000 --- a/spec/classes/apache_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'spec_helper' - -describe 'apache', :type => :class do - - it { should include_class("apache::params") } - - it { should contain_package("httpd") } - - it { should contain_service("httpd").with( - 'ensure' => 'running', - 'enable' => 'true', - 'subscribe' => 'Package[httpd]' - ) - } - - it { should contain_file("httpd_vdir").with( - 'ensure' => 'directory', - 'recurse' => 'true', - 'purge' => 'true', - 'notify' => 'Service[httpd]', - 'require' => 'Package[httpd]' - ) - } -end diff --git a/spec/classes/dev_spec.rb b/spec/classes/dev_spec.rb deleted file mode 100644 index 57d913d..0000000 --- a/spec/classes/dev_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'spec_helper' - -describe 'apache::dev', :type => :class do - - it { should include_class("apache::params") } - it { should contain_package("apache_dev_package") } - -end diff --git a/spec/classes/mod/python_spec.rb b/spec/classes/mod/python_spec.rb deleted file mode 100644 index 166e290..0000000 --- a/spec/classes/mod/python_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spec_helper' - -describe 'apache::mod::python', :type => :class do - - it { should include_class("apache") } - - it { should contain_package("mod_python_package").with( - 'ensure' => 'installed', - 'require' => 'Package[httpd]' - ) - } - - it { should contain_a2mod("python").with( - 'ensure' => 'present' - ) - } - -end diff --git a/spec/classes/mod/wsgi_spec.rb b/spec/classes/mod/wsgi_spec.rb deleted file mode 100644 index c1c8dc9..0000000 --- a/spec/classes/mod/wsgi_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'spec_helper' - -describe 'apache::mod::wsgi', :type => :class do - - it { should include_class("apache") } - - it { should contain_package("mod_wsgi_package").with( - 'require' => 'Package[httpd]' - ) - } - - it { should contain_a2mod("wsgi").with( - 'ensure' => 'present' - ) - } - -end diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb deleted file mode 100644 index 7236c2d..0000000 --- a/spec/classes/params_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'spec_helper' - -describe 'apache::params', :type => :class do - - it { should contain_apache__params } - - # There are 4 resources in this class currently - # there should not be any more resources because it is a params class - # The resources are class[apache::params], class[main], class[settings], stage[main] - it "Should not contain any resources" do - subject.resources.size.should == 4 - end -end diff --git a/spec/classes/php_spec.rb b/spec/classes/php_spec.rb deleted file mode 100644 index 33413f0..0000000 --- a/spec/classes/php_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'spec_helper' - -describe 'apache::php', :type => :class do - - it { should include_class("apache::params") } - it { should contain_package("apache_php_package") } - -end diff --git a/spec/classes/python_spec.rb b/spec/classes/python_spec.rb deleted file mode 100644 index aae899d..0000000 --- a/spec/classes/python_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'spec_helper' - -describe 'apache::python', :type => :class do - - it { should include_class("apache") } - it { should include_class("apache::params") } - it { should contain_package("apache_python_package") } - it { should contain_a2mod("python").with( - 'ensure' => 'present' - ) - } - -end diff --git a/spec/classes/ssl_spec.rb b/spec/classes/ssl_spec.rb deleted file mode 100644 index 60e1d81..0000000 --- a/spec/classes/ssl_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -require 'spec_helper' - -describe 'apache::ssl', :type => :class do - - describe 'when running on an unsupported OS' do - let(:facts) { {:operatingsystem => 'MagicUnicorn'} } - it { - expect { - should raise_error(Puppet::Error, /not defined in apache::ssl/ ) - } - } - end - - describe 'when running on a supported OS' do - let(:facts) { {:operatingsystem => 'redhat'} } - it { should include_class('apache') } - it { should include_class('apache::params') } - end - - describe 'when running on redhat' do - let(:facts) { {:operatingsystem => 'redhat'} } - it { - should contain_package('apache_ssl_package').with( - 'ensure' => 'installed' - ) - } - end - - describe 'when running on debian' do - let(:facts) { {:operatingsystem => 'debian'} } - it { - should contain_a2mod('ssl').with('ensure' => 'present') - } - end - -end diff --git a/spec/defines/vhost/proxy_spec.rb b/spec/defines/vhost/proxy_spec.rb deleted file mode 100644 index 7989086..0000000 --- a/spec/defines/vhost/proxy_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'spec_helper' - -describe 'apache::vhost::proxy', :type => :define do - - let :title do - 'my_proxy_vhost' - end - - let :facts do - { :operatingsystem => 'redhat' } - end - - let :default_params do - { - :port => '80', - :dest => 'example.com', - :priority => '10', - :template => "apache/vhost-proxy.conf.erb", - :servername => '', - :serveraliases => '', - :ssl => false, - :vhost_name => '*' - } - end - - [{ - :dest => 'example2.com', - :port => '80', - :ssl => true - }, - ].each do |param_set| - - describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do - - let :param_hash do - default_params.merge(param_set) - end - - let :params do - param_set - end - - it { should include_class("apache") } - it { should contain_apache__params } - - it { - if param_hash[:ssl] - should contain_apache__ssl - else - should_not contain_apache__ssl - end - } - - it { should contain_file("#{param_hash[:priority]}-#{title}").with({ - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0755', - 'require' => 'Package[httpd]', - 'notify' => 'Service[httpd]' - }) - } - end - end -end diff --git a/spec/defines/vhost/redirect_spec.rb b/spec/defines/vhost/redirect_spec.rb deleted file mode 100644 index 6eddfd0..0000000 --- a/spec/defines/vhost/redirect_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'spec_helper' - -describe 'apache::vhost::redirect', :type => :define do - let :title do - 'my_vhost_redirect' - end - - - let :default_params do - { - :port => '80', - :dest => 'example.com', - :priority => '10', - :template => "apache/vhost-redirect.conf.erb", - :vhost_name => '*' - } - end - - [{ - :dest => 'example2.com', - :port => '80', - }, - ].each do |param_set| - - describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do - - let :param_hash do - default_params.merge(param_set) - end - - let :params do - param_set - end - - it { should include_class("apache") } - it { should contain_apache__params } - - it { should contain_file("#{param_hash[:priority]}-#{title}").with({ - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0755', - 'require' => 'Package[httpd]', - 'notify' => 'Service[httpd]' - }) - } - - # FIXME: Firewall is not actually realized anywhere - #it { should contain_firewall("0100-INPUT ACCEPT #{param_hash[:port]}").with( { - # 'jump' => 'Accept', - # 'dport' => "#{param_hash[:port]}", - # 'proto' => 'tcp' - # }) - #} - end - end -end diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb deleted file mode 100644 index a9f162b..0000000 --- a/spec/defines/vhost_spec.rb +++ /dev/null @@ -1,77 +0,0 @@ -require 'spec_helper' - -describe 'apache::vhost', :type => :define do - - let :title do - 'my_vhost' - end - - let :default_params do - { - :apache_name => 'apache2', - :auth => false, - :docroot => 'path/to/docroot', - :options => 'Indexes FollowSymLinks MultiViews', - :port => '80', - :priority => '25', - :redirect_ssl => false, - :serveraliases => '', - :servername => '', - :ssl => true, - :template => 'apache/vhost-default.conf.erb', - :vhost_name => '*' - } - end - - [{ - :apache_name => 'httpd', - :docroot => 'path/to/docroot', - :port => '80', - :priority => '25', - :ssl => false, - :template => 'apache/vhost-default.conf.erb', - }, - ].each do |param_set| - - describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do - - let :param_hash do - default_params.merge(param_set) - end - - let :params do - param_set - end - - it { should include_class("apache") } - it { should contain_apache__params } - - it { - if param_hash[:ssl] - should contain_apache__ssl - else - should_not contain_apache__ssl - end - } - - it { should contain_file("#{param_hash[:priority]}-#{title}.conf").with({ - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0755', - 'require' => 'Package[httpd]', - 'notify' => 'Service[httpd]' - }) - } - - # FIXME: Firewall is not actually realized anywhere - #it { should contain_firewall("0100-INPUT ACCEPT #{param_hash[:port]}").with( { - # 'action' => 'accept', - # 'dport' => "#{param_hash[:port]}", - # 'proto' => 'tcp' - # }) - #} - - - end - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index d2648da..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'puppet' -require 'rubygems' -require 'rspec-puppet' - -def param_value(subject, type, title, param) - subject.resource(type, title).send(:parameters)[param.to_sym] -end - -RSpec.configure do |c| - c.module_path = File.join(File.dirname(__FILE__), '../../') -end