summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/file_serving/mount/file.rb8
-rwxr-xr-xspec/unit/network/http/handler.rb10
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/unit/file_serving/mount/file.rb b/spec/unit/file_serving/mount/file.rb
index 837fe8e62..69660d62f 100755
--- a/spec/unit/file_serving/mount/file.rb
+++ b/spec/unit/file_serving/mount/file.rb
@@ -107,6 +107,14 @@ describe Puppet::FileServing::Mount::File, "when determining the complete file p
@mount.complete_path("/my/path", nil).should be_nil
end
+ it "should write a log message if the file is absent" do
+ FileTest.stubs(:exist?).returns(false)
+
+ Puppet.expects(:info).with("File does not exist or is not accessible: /mount/my/path")
+
+ @mount.complete_path("/my/path", nil)
+ end
+
it "should return the file path if the file is present" do
FileTest.stubs(:exist?).with("/my/path").returns(true)
@mount.complete_path("/my/path", nil).should == "/mount/my/path"
diff --git a/spec/unit/network/http/handler.rb b/spec/unit/network/http/handler.rb
index 1addb5890..559812159 100755
--- a/spec/unit/network/http/handler.rb
+++ b/spec/unit/network/http/handler.rb
@@ -230,6 +230,16 @@ describe Puppet::Network::HTTP::Handler do
@handler.do_find(@irequest, @request, @response)
end
+ it "should write a log message when no model instance can be found" do
+ @model_class.stubs(:name).returns "my name"
+ @model_class.stubs(:find).returns(nil)
+
+ Puppet.expects(:info).with("Could not find my_handler for 'my_result'")
+
+ @handler.do_find(@irequest, @request, @response)
+ end
+
+
it "should serialize the result in with the appropriate format" do
@model_instance = stub('model instance')