1 #! /usr/bin/env ruby -S rspec
4 describe "the parseyaml function" do
5 let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
8 expect(Puppet::Parser::Functions.function("parseyaml")).to eq("function_parseyaml")
11 it "should raise a ParseError if there is less than 1 arguments" do
12 expect { scope.function_parseyaml([]) }.to( raise_error(Puppet::ParseError))
15 it "should convert YAML to a data structure" do
21 result = scope.function_parseyaml([yaml])
22 expect(result).to(eq(['aaa','bbb','ccc']))