hash_spec.rb 613 B

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