Skip to content

Commit

Permalink
test case for when the file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
amateo committed Apr 13, 2015
1 parent b9560df commit ac24e7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/functions/loadyaml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit ac24e7a

Please sign in to comment.