From 8865bdf112b33660a3e41b03f57d2575809e3cb4 Mon Sep 17 00:00:00 2001 From: Andrew Shafer Date: Fri, 4 Jul 2008 08:24:14 -0600 Subject: file object creation should fail if source is not present removed described? logic from insync? in ensure.rb and source.rb raise in source#retrieve if the source is not found --- spec/unit/type/file.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec') diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb index 12b806d88..f0ae70cd0 100755 --- a/spec/unit/type/file.rb +++ b/spec/unit/type/file.rb @@ -31,6 +31,18 @@ describe Puppet::Type.type(:file) do end end + describe "when specifying a source" do + before do + @file[:source] = "/bar" + end + + it "should raise if source doesn't exist" do + @file.property(:source).expects(:found?).returns(false) + lambda { @file.retrieve }.should raise_error(Puppet::Error) + end + + end + describe "when retrieving remote files" do before do @filesource = Puppet::Type::File::FileSource.new -- cgit