getvar_spec.rb 570 B

123456789101112131415161718192021222324
  1. require 'spec_helper_acceptance'
  2. describe 'getvar function' do
  3. describe 'success' do
  4. pp = <<-DOC
  5. class a::data { $foo = 'aoeu' }
  6. include a::data
  7. $b = 'aoeu'
  8. $o = getvar("a::data::foo")
  9. if $o == $b {
  10. notify { 'output correct': }
  11. }
  12. DOC
  13. it 'getvars from classes' 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-numbers'
  22. end
  23. end