summaryrefslogtreecommitdiffstats
path: root/spec/shared_behaviours/file_serving.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/shared_behaviours/file_serving.rb')
-rw-r--r--spec/shared_behaviours/file_serving.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/shared_behaviours/file_serving.rb b/spec/shared_behaviours/file_serving.rb
index c86453a03..5f5b2b0af 100644
--- a/spec/shared_behaviours/file_serving.rb
+++ b/spec/shared_behaviours/file_serving.rb
@@ -15,7 +15,7 @@ describe "Puppet::FileServing::Files", :shared => true do
@test_class.find(uri)
end
- it "should use the rest terminus when the 'puppet' URI scheme is used, no host name is present, and the process name is not 'puppet'" do
+ it "should use the rest terminus when the 'puppet' URI scheme is used, no host name is present, and the process name is not 'puppet' or 'apply'" do
uri = "puppet:///fakemod/my/file"
Puppet.settings.stubs(:value).returns "foo"
Puppet.settings.stubs(:value).with(:name).returns("puppetd")
@@ -35,6 +35,17 @@ describe "Puppet::FileServing::Files", :shared => true do
@test_class.find(uri)
end
+ it "should use the file_server terminus when the 'puppet' URI scheme is used, no host name is present, and the process name is 'apply'" do
+ uri = "puppet:///fakemod/my/file"
+ Puppet::Node::Environment.stubs(:new).returns(stub("env", :name => "testing", :module => nil, :modulepath => []))
+ Puppet.settings.stubs(:value).returns ""
+ Puppet.settings.stubs(:value).with(:name).returns("apply")
+ Puppet.settings.stubs(:value).with(:fileserverconfig).returns("/whatever")
+ @indirection.terminus(:file_server).expects(:find)
+ @indirection.terminus(:file_server).stubs(:authorized?).returns(true)
+ @test_class.find(uri)
+ end
+
it "should use the file terminus when the 'file' URI scheme is used" do
uri = "file:///fakemod/my/file"
@indirection.terminus(:file).expects(:find)