summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2009-08-02 11:20:30 +0200
committerJames Turnbull <james@lovedthanlost.net>2009-08-03 07:42:54 +1000
commit266aafa6efa9dff5fb0b49ffdafc9372edcafdfe (patch)
treefef3c920a0275cb040d13f778e543ff0e4994f7e /spec/unit
parent1f8ef6086cc1bb27035cc2534fac781a0349bfb5 (diff)
downloadpuppet-266aafa6efa9dff5fb0b49ffdafc9372edcafdfe.tar.gz
puppet-266aafa6efa9dff5fb0b49ffdafc9372edcafdfe.tar.xz
puppet-266aafa6efa9dff5fb0b49ffdafc9372edcafdfe.zip
default server in remote filebuckets
With the path parameter set to false, the server defaults to Puppet[:server]. This allows to use a remote filebucket without syncing the servername there with the one used on the config file. To use the default server, this manifest can be used: filebucket { main: path => false } A related bug report is: http://projects.reductivelabs.com/issues/2456
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/type/filebucket.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/unit/type/filebucket.rb b/spec/unit/type/filebucket.rb
new file mode 100644
index 000000000..9a635d517
--- /dev/null
+++ b/spec/unit/type/filebucket.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe Puppet::Type.type(:filebucket) do
+ it "be local by default" do
+ bucket = Puppet::Type.type(:filebucket).new :name => "main"
+
+ bucket.name.should == "main"
+ bucket.bucket.should be_instance_of(Puppet::Network::Client::Dipper)
+ bucket.bucket.local.should == true
+ end
+
+ it "not be local if path is false" do
+ bucket = Puppet::Type.type(:filebucket).new :name => "main", :path => false
+
+ bucket.name.should == "main"
+ bucket.bucket.should be_instance_of(Puppet::Network::Client::Dipper)
+ bucket.bucket.local.should_not == true
+ end
+
+ it "not be local if a server is specified" do
+ bucket = Puppet::Type.type(:filebucket).new :name => "main", :server => "puppet"
+
+ bucket.name.should == "main"
+ bucket.bucket.should be_instance_of(Puppet::Network::Client::Dipper)
+ bucket.bucket.local.should_not == true
+ end
+
+end