1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'parseyaml function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'parses valid yaml' do
8 $a = "---\nhunter: washere\ntests: passing\n"
11 notice(inline_template('tests are <%= @tests.inspect %>'))
14 apply_manifest(pp, :catch_failures => true) do |r|
15 expect(r.stdout).to match(/tests are "passing"/)
20 it 'raises error on incorrect yaml' do
22 $a = "---\nhunter: washere\ntests: passing\n:"
25 notice(inline_template('tests are <%= @tests.inspect %>'))
28 apply_manifest(pp, :expect_failures => true) do |r|
29 expect(r.stderr).to match(/(syntax error|did not find expected key)/)
33 it 'raises error on incorrect number of arguments'