summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorAndrew Shafer <andrew@reductivelabs.com>2008-07-04 08:24:14 -0600
committerAndrew Shafer <andrew@reductivelabs.com>2008-07-04 08:24:14 -0600
commit8865bdf112b33660a3e41b03f57d2575809e3cb4 (patch)
tree48f0b36953430a5073c4f0588df148ef79d84ff1 /spec
parent7a6ae299621a16fa7fd8ab0fbd2c05fe723cffa4 (diff)
downloadpuppet-8865bdf112b33660a3e41b03f57d2575809e3cb4.tar.gz
puppet-8865bdf112b33660a3e41b03f57d2575809e3cb4.tar.xz
puppet-8865bdf112b33660a3e41b03f57d2575809e3cb4.zip
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
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/type/file.rb12
1 files changed, 12 insertions, 0 deletions
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