ceiling_spec.rb 823 B

12345678910111213141516171819202122232425262728293031323334353637
  1. require 'spec_helper_acceptance'
  2. describe 'ceiling function' do
  3. describe 'success' do
  4. pp1 = <<-DOC
  5. $a = 12.8
  6. $b = 13
  7. $o = ceiling($a)
  8. if $o == $b {
  9. notify { 'output correct': }
  10. }
  11. DOC
  12. it 'ceilings floats' do
  13. apply_manifest(pp1, :catch_failures => true) do |r|
  14. expect(r.stdout).to match(%r{Notice: output correct})
  15. end
  16. end
  17. pp2 = <<-DOC
  18. $a = 7
  19. $b = 7
  20. $o = ceiling($a)
  21. if $o == $b {
  22. notify { 'output is correct': }
  23. }
  24. DOC
  25. it 'ceilings integers' do
  26. apply_manifest(pp2, :catch_failures => true) do |r|
  27. expect(r.stdout).to match(%r{Notice: output is correct})
  28. end
  29. end
  30. end
  31. describe 'failure' do
  32. it 'handles improper argument counts'
  33. it 'handles non-numbers'
  34. end
  35. end