summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-06-11 18:56:36 -0500
committerLuke Kanies <luke@madstop.com>2008-06-11 18:56:36 -0500
commitfb5f09bc347553b2744e5d3b24ddfa26bc0b3c9e (patch)
tree4c7e6a83e055496301464e5dbb8f77ddfe3a199d
parent4b29a5ea234e2c0c36ab5fca8fa0f6dee0085a7e (diff)
downloadpuppet-fb5f09bc347553b2744e5d3b24ddfa26bc0b3c9e.tar.gz
puppet-fb5f09bc347553b2744e5d3b24ddfa26bc0b3c9e.tar.xz
puppet-fb5f09bc347553b2744e5d3b24ddfa26bc0b3c9e.zip
Fixing how the Indirector::Request sets its options.
I wasn't testing whether the options where still a hash, and an 'inject' loop wasn't returning correctly, so the options weren't being set correctly.
-rw-r--r--lib/puppet/indirector/request.rb1
-rwxr-xr-xspec/unit/indirector/request.rb8
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/indirector/request.rb b/lib/puppet/indirector/request.rb
index 45c06670b..98fa38885 100644
--- a/lib/puppet/indirector/request.rb
+++ b/lib/puppet/indirector/request.rb
@@ -24,6 +24,7 @@ class Puppet::Indirector::Request
else
result[param] = value
end
+ result
end
if key.is_a?(String) or key.is_a?(Symbol)
diff --git a/spec/unit/indirector/request.rb b/spec/unit/indirector/request.rb
index 4f0ad8b6a..f7702f821 100755
--- a/spec/unit/indirector/request.rb
+++ b/spec/unit/indirector/request.rb
@@ -67,6 +67,14 @@ describe Puppet::Indirector::Request do
it "should set be marked authenticated if configured in the options" do
Puppet::Indirector::Request.new(:ind, :method, :key, :authenticated => "eh").should be_authenticated
end
+
+ it "should keep its options as a hash even if a node is specified" do
+ Puppet::Indirector::Request.new(:ind, :method, :key, :node => "eh").options.should be_instance_of(Hash)
+ end
+
+ it "should keep its options as a hash even if another option is specified" do
+ Puppet::Indirector::Request.new(:ind, :method, :key, :foo => "bar").options.should be_instance_of(Hash)
+ end
end
it "should look use the Indirection class to return the appropriate indirection" do