diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-03-15 14:16:09 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | e5a78009f6bd593e7e3957f0dadb470e623396dd (patch) | |
| tree | f1d386962e4a7ef5b4e20347653e570dccd141bf /spec/unit/application | |
| parent | f838389da0530201849958444dbbe60977935ad0 (diff) | |
Feature #3347 REST-ified FileBucket
FileBucket Files have been reimplemented as an indirector terminus so that
they can be transmitted over REST.
The old Network::Client.dipper has been replaced with a compatibility later
in FileBucket::Dipper that uses the indirector to access filebucket termini.
Slightly revised patch:
* No longer allows nil contents in FileBucket outside of initialization
* Uses File.exist? instead of the deprecated File.exists?
* Tweaks JSON serialization and de-serialization to include "path"
Deferred issues:
* Feature #3371 "FileBucket should not keep files in memory".
* Feature #3372 "Replace FileBucket Dipper with more idiomatic calls"
Diffstat (limited to 'spec/unit/application')
| -rw-r--r-- | spec/unit/application/filebucket.rb | 14 | ||||
| -rwxr-xr-x | spec/unit/application/main.rb | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/spec/unit/application/filebucket.rb b/spec/unit/application/filebucket.rb index e87bab402..f78c0b7be 100644 --- a/spec/unit/application/filebucket.rb +++ b/spec/unit/application/filebucket.rb @@ -43,7 +43,7 @@ describe "Filebucket" do Puppet.stubs(:settraps) Puppet::Log.stubs(:level=) Puppet.stubs(:parse_config) - Puppet::Network::Client.dipper.stubs(:new) + Puppet::FileBucket::Dipper.stubs(:new) @filebucket.options.stubs(:[]).with(any_parameters) end @@ -106,15 +106,15 @@ describe "Filebucket" do it "should create a client with the default bucket if none passed" do Puppet.stubs(:[]).with(:bucketdir).returns("path") - Puppet::Network::Client::Dipper.expects(:new).with { |h| h[:Path] == "path" } + Puppet::FileBucket::Dipper.expects(:new).with { |h| h[:Path] == "path" } @filebucket.run_setup end - it "should create a local Client dipper with the given bucket" do + it "should create a local Dipper with the given bucket" do @filebucket.options.stubs(:[]).with(:bucket).returns("path") - Puppet::Network::Client::Dipper.expects(:new).with { |h| h[:Path] == "path" } + Puppet::FileBucket::Dipper.expects(:new).with { |h| h[:Path] == "path" } @filebucket.run_setup end @@ -126,7 +126,7 @@ describe "Filebucket" do it "should create a remote Client to the configured server" do Puppet.stubs(:[]).with(:server).returns("puppet.reductivelabs.com") - Puppet::Network::Client::Dipper.expects(:new).with { |h| h[:Server] == "puppet.reductivelabs.com" } + Puppet::FileBucket::Dipper.expects(:new).with { |h| h[:Server] == "puppet.reductivelabs.com" } @filebucket.run_setup end @@ -142,11 +142,11 @@ describe "Filebucket" do Puppet.stubs(:settraps) Puppet::Log.stubs(:level=) Puppet.stubs(:parse_config) - Puppet::Network::Client.dipper.stubs(:new) + Puppet::FileBucket::Dipper.stubs(:new) @filebucket.options.stubs(:[]).with(any_parameters) @client = stub 'client' - Puppet::Network::Client::Dipper.stubs(:new).returns(@client) + Puppet::FileBucket::Dipper.stubs(:new).returns(@client) @filebucket.run_setup end diff --git a/spec/unit/application/main.rb b/spec/unit/application/main.rb index 74c40c14a..ea8c43fe6 100755 --- a/spec/unit/application/main.rb +++ b/spec/unit/application/main.rb @@ -53,7 +53,7 @@ describe "Puppet" do Puppet.stubs(:trap) Puppet::Log.stubs(:level=) Puppet.stubs(:parse_config) - Puppet::Network::Client.dipper.stubs(:new) + Puppet::FileBucket::Dipper.stubs(:new) STDIN.stubs(:read) @main.options.stubs(:[]).with(any_parameters) |
