delete_values_spec.rb 614 B

1234567891011121314151617181920212223
  1. require 'spec_helper_acceptance'
  2. describe 'delete_values function' do
  3. describe 'success' do
  4. pp = <<-DOC
  5. $a = { 'a' => 'A', 'b' => 'B', 'B' => 'C', 'd' => 'B' }
  6. $b = { 'a' => 'A', 'B' => 'C' }
  7. $o = delete_values($a, 'B')
  8. if $o == $b {
  9. notify { 'output correct': }
  10. }
  11. DOC
  12. it 'deletes elements of the hash' 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. end
  18. describe 'failure' do
  19. it 'handles non-hash arguments'
  20. it 'handles improper argument counts'
  21. end
  22. end