diff options
| author | Luke Kanies <luke@madstop.com> | 2008-08-23 22:00:19 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-08-26 22:40:40 -0700 |
| commit | a0bda8532f5e1e9f5bb29eb92f389383ae0857d5 (patch) | |
| tree | d72d17177926d38773c30614ba52f94ae64ea33b /spec/shared_behaviours | |
| parent | 6335b143a312481aaa200f71cd25dffd4f88c8ae (diff) | |
| download | puppet-a0bda8532f5e1e9f5bb29eb92f389383ae0857d5.tar.gz puppet-a0bda8532f5e1e9f5bb29eb92f389383ae0857d5.tar.xz puppet-a0bda8532f5e1e9f5bb29eb92f389383ae0857d5.zip | |
Removing the yaml conversion code from FileContent.
Also fixing some integration tests that were failing
because of the change to the terminus selection code
for file serving.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/shared_behaviours')
| -rw-r--r-- | spec/shared_behaviours/file_serving.rb | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/spec/shared_behaviours/file_serving.rb b/spec/shared_behaviours/file_serving.rb index ba01f75a1..99994b99a 100644 --- a/spec/shared_behaviours/file_serving.rb +++ b/spec/shared_behaviours/file_serving.rb @@ -6,12 +6,18 @@ describe "Puppet::FileServing::Files", :shared => true do it "should use the rest terminus when the 'puppet' URI scheme is used and a host name is present" do uri = "puppet://myhost/fakemod/my/file" - @indirection.terminus(:rest).expects(:find) + + # It appears that the mocking somehow interferes with the caching subsystem. + # This mock somehow causes another terminus to get generated. + term = @indirection.terminus(:rest) + @indirection.stubs(:terminus).with(:rest).returns term + term.expects(:find) @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 uri = "puppet:///fakemod/my/file" + Puppet.settings.stubs(:value).returns "foo" Puppet.settings.stubs(:value).with(:name).returns("puppetd") Puppet.settings.stubs(:value).with(:modulepath).returns("") @indirection.terminus(:rest).expects(:find) @@ -21,19 +27,9 @@ 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:///fakemod/my/file" Puppet::Node::Environment.stubs(:new).returns(stub("env", :name => "testing")) + Puppet.settings.stubs(:value).returns "" Puppet.settings.stubs(:value).with(:name).returns("puppet") - Puppet.settings.stubs(:value).with(:modulepath, "testing").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) - @indirection.terminus(:file_server).stubs(:authorized?).returns(true) - @test_class.find(uri) - end - - it "should use the file_server terminus when the 'puppetmounts' URI scheme is used" do - uri = "puppetmounts:///fakemod/my/file" @indirection.terminus(:file_server).expects(:find) @indirection.terminus(:file_server).stubs(:authorized?).returns(true) @test_class.find(uri) @@ -52,7 +48,7 @@ describe "Puppet::FileServing::Files", :shared => true do end it "should use the configuration to test whether the request is allowed" do - uri = "puppetmounts:///fakemod/my/file" + uri = "fakemod/my/file" config = mock 'configuration' @indirection.terminus(:file_server).stubs(:configuration).returns config @@ -61,4 +57,3 @@ describe "Puppet::FileServing::Files", :shared => true do @test_class.find(uri, :node => "foo", :ip => "bar") end end - |
