diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-07-22 16:26:10 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-07-22 16:27:23 -0700 |
commit | ae360034c07f9b16467f5ae245ac6d037789ee13 (patch) | |
tree | ccc4cc8212e4948022c8e7738858eb8ee0add25a /spec/unit/indirector | |
parent | 88e9cd2138e9f23e056bd3331498a6d4723a8b0c (diff) | |
download | puppet-ae360034c07f9b16467f5ae245ac6d037789ee13.tar.gz puppet-ae360034c07f9b16467f5ae245ac6d037789ee13.tar.xz puppet-ae360034c07f9b16467f5ae245ac6d037789ee13.zip |
(#7290) Update indirected Faces to avoid unknown options.
Now that we enforce that options must be declared, the model we exposed in the
Ruby API (but not the CLI facade) was that you could pass additional arguments
to the indirection method by passing them as unknown options doesn't work.
Instead, explicitly declare an option, `extra`, that accepts the final
argument to be passed direct to the indirection. This makes things work
smoothly, as well as making it possible (once you can input a hash on the
command line) to invoke extra arguments from the facade too...
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
Diffstat (limited to 'spec/unit/indirector')
-rwxr-xr-x | spec/unit/indirector/face_spec.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/unit/indirector/face_spec.rb b/spec/unit/indirector/face_spec.rb index 943ff7991..8e324f019 100755 --- a/spec/unit/indirector/face_spec.rb +++ b/spec/unit/indirector/face_spec.rb @@ -12,6 +12,8 @@ describe Puppet::Indirector::Face do instance end + it { should be_option :extra } + it "should be able to return a list of indirections" do Puppet::Indirector::Face.indirections.should be_include("catalog") end @@ -48,7 +50,7 @@ describe Puppet::Indirector::Face do end it "should forward passed options" do subject.indirection.expects(method).with(:test, {'one'=>'1'}) - subject.send(method, :test, {'one'=>'1'}) + subject.send(method, :test, :extra => {'one'=>'1'}) end end |