]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/apache/spec/acceptance/itk_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / apache / spec / acceptance / itk_spec.rb
diff --git a/3rdparty/modules/apache/spec/acceptance/itk_spec.rb b/3rdparty/modules/apache/spec/acceptance/itk_spec.rb
new file mode 100644 (file)
index 0000000..2dde8f4
--- /dev/null
@@ -0,0 +1,33 @@
+require 'spec_helper_acceptance'
+
+case fact('osfamily')
+when 'Debian'
+  service_name = 'apache2'
+when 'FreeBSD'
+  service_name = 'apache24'
+else
+  # Not implemented yet
+  service_name = :skip
+end
+
+describe 'apache::mod::itk class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) or service_name.equal? :skip do
+  describe 'running puppet code' do
+    # Using puppet_apply as a helper
+    it 'should work with no errors' do
+      pp = <<-EOS
+          class { 'apache':
+            mpm_module => 'itk',
+          }
+      EOS
+
+      # Run it twice and test for idempotency
+      apply_manifest(pp, :catch_failures => true)
+      expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
+    end
+  end
+
+  describe service(service_name) do
+    it { is_expected.to be_running }
+    it { is_expected.to be_enabled }
+  end
+end