grep_spec.rb 558 B

123456789101112131415161718192021222324
  1. require 'spec_helper_acceptance'
  2. describe 'grep function' do
  3. describe 'success' do
  4. pp = <<-DOC
  5. $a = ['aaabbb','bbbccc','dddeee']
  6. $b = 'bbb'
  7. $c = ['aaabbb','bbbccc']
  8. $o = grep($a,$b)
  9. if $o == $c {
  10. notify { 'output correct': }
  11. }
  12. DOC
  13. it 'greps arrays' do
  14. apply_manifest(pp, :catch_failures => true) do |r|
  15. expect(r.stdout).to match(%r{Notice: output correct})
  16. end
  17. end
  18. end
  19. describe 'failure' do
  20. it 'handles improper argument counts'
  21. it 'handles non-arrays'
  22. end
  23. end