File: itk_spec.rb

package info (click to toggle)
puppet-module-puppetlabs-apache 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,344 kB
  • ctags: 30
  • sloc: ruby: 6,274; sh: 44; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 832 bytes parent folder | download
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_acceptance'

case fact('osfamily')
when 'Debian'
  service_name = 'apache2'
when 'FreeBSD'
  service_name = 'apache22'
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 { should be_running }
    it { should be_enabled }
  end
end