diff --git a/spec/functions/loadyaml_spec.rb b/spec/functions/loadyaml_spec.rb index cdc3d6f51..4b8d40623 100755 --- a/spec/functions/loadyaml_spec.rb +++ b/spec/functions/loadyaml_spec.rb @@ -14,6 +14,12 @@ expect { scope.function_loadyaml([]) }.to raise_error(Puppet::ParseError) end + it "should return nil when file does not exist" do + yaml_file = tmpfilename ('yamlfile') + result = scope.function_loadyaml([yaml_file]) + expect(result).to(eq(nil)) + end + it "should convert YAML file to a data structure" do yaml_file = tmpfilename ('yamlfile') File.open(yaml_file, 'w') do |fh|