summaryrefslogtreecommitdiff
path: root/spec/acceptance/parseyaml_spec.rb
diff options
context:
space:
mode:
authorMorgan Haskel <morgan@puppetlabs.com>2015-09-21 10:56:08 -0700
committerMorgan Haskel <morgan@puppetlabs.com>2015-09-21 11:11:21 -0700
commit799c38e14e1583e676e2b25a9c1782fd40e29fff (patch)
treeca2f93dd6d459eac114f1e0b5cac05ac02d519cd /spec/acceptance/parseyaml_spec.rb
parent9b1932c538354c1b360838c8cf7b942af314c99d (diff)
Fix backwards compatibility from #511
Maintain the old behavior in the case where the optional second parameter isn't passed. Also, adding arity is backwards incompatible since stdlib still supports 2.7, so remove that.
Diffstat (limited to 'spec/acceptance/parseyaml_spec.rb')
-rwxr-xr-xspec/acceptance/parseyaml_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/acceptance/parseyaml_spec.rb b/spec/acceptance/parseyaml_spec.rb
index 7946de0..64511f1 100755
--- a/spec/acceptance/parseyaml_spec.rb
+++ b/spec/acceptance/parseyaml_spec.rb
@@ -31,6 +31,20 @@ describe 'parseyaml function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('o
end
end
+ it 'raises error on incorrect yaml' do
+ pp = <<-EOS
+ $a = "---\nhunter: washere\ntests: passing\n:"
+ $o = parseyaml($a)
+ $tests = $o['tests']
+ notice(inline_template('tests are <%= @tests.inspect %>'))
+ EOS
+
+ apply_manifest(pp, :expect_failures => true) do |r|
+ expect(r.stderr).to match(/(syntax error|did not find expected key)/)
+ end
+ end
+
+
it 'raises error on incorrect number of arguments' do
pp = <<-EOS
$o = parseyaml()