diff options
| author | Markus Roberts <Markus@reality.com> | 2010-08-21 19:44:06 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-08-24 18:08:22 -0700 |
| commit | c3185584a0c9f22b7deaff022855b160a945486f (patch) | |
| tree | 58d6b918c782173672439ad03450d24a545eed6b /spec/shared_behaviours | |
| parent | 491c31dcbdb0977c0377cb276cfe32a4c24e0e1a (diff) | |
| download | puppet-c3185584a0c9f22b7deaff022855b160a945486f.tar.gz puppet-c3185584a0c9f22b7deaff022855b160a945486f.tar.xz puppet-c3185584a0c9f22b7deaff022855b160a945486f.zip | |
Fix for #4489 -- apply was using the rest terminus
Basing pervasive low-level behaviour changes on the application name isn't a
good idea, but if we're going to do it we need to remember to update the test
when we rename the application.
I am not certain that this change is globally correct; there may be other
related problems that will not be fixed (and may in fact be exacerbated) by
this patch.
Diffstat (limited to 'spec/shared_behaviours')
| -rw-r--r-- | spec/shared_behaviours/file_serving.rb | 13 |
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) |
