summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorDan Bode <dan@puppetlabs.com>2011-04-06 21:14:06 -0400
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-07 16:18:49 -0700
commit292a8b92c74c8d9392348ef6e9718934471a0ac1 (patch)
tree649316b94038b0c4586ffa637b579cdd99bfae86 /spec
parentd04567ff8e6a060e505293d099303dceb9a73096 (diff)
downloadpuppet-292a8b92c74c8d9392348ef6e9718934471a0ac1.tar.gz
puppet-292a8b92c74c8d9392348ef6e9718934471a0ac1.tar.xz
puppet-292a8b92c74c8d9392348ef6e9718934471a0ac1.zip
(#6985) Allows indirectors to accept a hash as an argument.
Many indirectors need to take a hash as the last argument. This was not allowed b/c the last hash argument was assumed to be the options hash. I resolved this by assuming that the hash needed by an indirector would be the same as the options hash. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/faces/indirector_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/unit/faces/indirector_spec.rb b/spec/unit/faces/indirector_spec.rb
index 218694bd9..3ed64bc01 100755
--- a/spec/unit/faces/indirector_spec.rb
+++ b/spec/unit/faces/indirector_spec.rb
@@ -34,10 +34,14 @@ describe Puppet::Faces::Indirector do
Puppet::Faces::Indirector.should be_action(method)
end
- it "should call the indirection method when the '#{method}' action is invoked" do
- subject.indirection.expects(method).with(:test, "myargs")
+ it "should call the indirection method with options when the '#{method}' action is invoked" do
+ subject.indirection.expects(method).with(:test, "myargs", {})
subject.send(method, :test, "myargs")
end
+ it "should forward passed options" do
+ subject.indirection.expects(method).with(:test, "action", {'one'=>'1'})
+ subject.send(method, :test, 'action', {'one'=>'1'})
+ end
end
it "should be able to override its indirection name" do