class_spec.rb 695 B

1234567891011121314151617181920212223242526272829303132333435
  1. require 'spec_helper_system'
  2. describe "nginx class:" do
  3. case node.facts['osfamily']
  4. when 'RedHat'
  5. package_name = 'nginx'
  6. when 'Debian'
  7. package_name = 'nginx'
  8. when 'Suse'
  9. package_name = 'nginx-0.8'
  10. end
  11. context 'should run successfully' do
  12. it 'should run successfully' do
  13. pp = "class { 'nginx': }"
  14. puppet_apply(pp) do |r|
  15. #r.stderr.should be_empty
  16. [0,2].should include r.exit_code
  17. r.refresh
  18. #r.stderr.should be_empty
  19. r.exit_code.should be_zero
  20. end
  21. end
  22. end
  23. describe package(package_name) do
  24. it { should be_installed }
  25. end
  26. describe service('nginx') do
  27. it { should be_running }
  28. end
  29. end