summaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-10-21 19:37:17 -0500
committerLuke Kanies <luke@madstop.com>2007-10-21 19:37:17 -0500
commitb2b8f756c813f7c9a59ac91b4099304b4be2db4c (patch)
treef25f38591d35ede25d2d2670c9f0a6eefdf9f217 /spec/lib
parent8f827ffe4fa1aa25a2e3c7903967e87c55766996 (diff)
downloadpuppet-b2b8f756c813f7c9a59ac91b4099304b4be2db4c.tar.gz
puppet-b2b8f756c813f7c9a59ac91b4099304b4be2db4c.tar.xz
puppet-b2b8f756c813f7c9a59ac91b4099304b4be2db4c.zip
Adding authorization hooks to the file_server and
module_files indirection terminus types. Both hooks use the fileserver configuration, but the module_files hook only uses the 'modules' mount. Also moved all responsibility for knowing whether to use the 'modules' terminus type to the terminus selector; it was previously spread between that and the file_server terminus, which made some things annoyingly complicated. This normalizes the deprecation notices and the logic about how we make these decisions.
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/shared_behaviours/file_server_terminus.rb8
-rw-r--r--spec/lib/shared_behaviours/file_serving.rb2
2 files changed, 2 insertions, 8 deletions
diff --git a/spec/lib/shared_behaviours/file_server_terminus.rb b/spec/lib/shared_behaviours/file_server_terminus.rb
index 93634e7dc..c18d74f81 100644
--- a/spec/lib/shared_behaviours/file_server_terminus.rb
+++ b/spec/lib/shared_behaviours/file_server_terminus.rb
@@ -38,12 +38,4 @@ describe "Puppet::Indirector::FileServerTerminus", :shared => true do
@terminus.find("puppetmounts://myhost/one/my/file").should == :myinstance
end
-
- it "should try to use the modules terminus to find files" do
- path = "puppetmounts://myhost/one/my/file"
- @modules.stubs(:find).with(path, {}).returns(:myinstance)
- @terminus.indirection.stubs(:terminus).with(:modules).returns(@modules)
-
- @terminus.find("puppetmounts://myhost/one/my/file").should == :myinstance
- end
end
diff --git a/spec/lib/shared_behaviours/file_serving.rb b/spec/lib/shared_behaviours/file_serving.rb
index 5c1d87015..b0aa14fc0 100644
--- a/spec/lib/shared_behaviours/file_serving.rb
+++ b/spec/lib/shared_behaviours/file_serving.rb
@@ -21,9 +21,11 @@ describe "Puppet::FileServing::Files", :shared => true do
it "should use the file_server terminus when the 'puppet' URI scheme is used, no host name is present, and the process name is 'puppet'" do
uri = "puppet:///mymod/my/file"
Puppet.settings.stubs(:value).with(:name).returns("puppet")
+ Puppet.settings.stubs(:value).with(:modulepath, nil).returns("")
Puppet.settings.stubs(:value).with(:modulepath).returns("")
Puppet.settings.stubs(:value).with(:libdir).returns("")
Puppet.settings.stubs(:value).with(:fileserverconfig).returns("/whatever")
+ Puppet.settings.stubs(:value).with(:environment).returns("")
@indirection.terminus(:file_server).expects(:find).with(uri)
@test_class.find(uri)
end