basic_spec.rb 910 B

123456789101112131415161718192021222324252627282930313233
  1. require 'spec_helper_system'
  2. # Here we put the more basic fundamental tests, ultra obvious stuff.
  3. describe "basic tests:" do
  4. context 'make sure we have copied the module across' do
  5. # No point diagnosing any more if the module wasn't copied properly
  6. context shell 'ls /etc/puppet/modules/nginx' do
  7. its(:stdout) { should =~ /Modulefile/ }
  8. its(:stderr) { should be_empty }
  9. its(:exit_code) { should be_zero }
  10. end
  11. end
  12. #puppet smoke test
  13. context puppet_apply 'notice("foo")' do
  14. its(:stdout) { should =~ /foo/ }
  15. its(:stderr) { should be_empty }
  16. its(:exit_code) { should be_zero }
  17. end
  18. it 'nginx class should work with no errors' do
  19. pp = <<-EOS
  20. class { 'nginx': }
  21. EOS
  22. # Run it twice and test for idempotency
  23. puppet_apply(pp) do |r|
  24. [0,2].should include(r.exit_code)
  25. r.refresh
  26. r.exit_code.should be_zero
  27. end
  28. end
  29. end