diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-02 14:31:54 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-02 15:34:19 -0700 |
| commit | 86c6ec24f387fc70abc333fc4ac974b06b3ec80a (patch) | |
| tree | f0ec5e0d43f115b16dab5ec2568a9369436c7425 /spec/unit/face | |
| parent | c63e9c2394a30fe653908cd15967218d90fa34d6 (diff) | |
| download | puppet-86c6ec24f387fc70abc333fc4ac974b06b3ec80a.tar.gz puppet-86c6ec24f387fc70abc333fc4ac974b06b3ec80a.tar.xz puppet-86c6ec24f387fc70abc333fc4ac974b06b3ec80a.zip | |
maint: move the indirector face base out of puppet/face
We used to shove the base class Puppet::Face::Indirector next to the actual
faces; this made a bunch of things, including testing, confusing. Instead,
move it away into the indirector where it lives with the rest of the
indirector related things.
Reviewed-By: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec/unit/face')
| -rwxr-xr-x | spec/unit/face/indirector_spec.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/spec/unit/face/indirector_spec.rb b/spec/unit/face/indirector_spec.rb deleted file mode 100755 index e7dd44f3d..000000000 --- a/spec/unit/face/indirector_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env rspec -require 'spec_helper' -require 'puppet/face/indirector' - -describe Puppet::Face::Indirector do - subject do - instance = Puppet::Face::Indirector.new(:test, '0.0.1') - indirection = stub('indirection', - :name => :stub_indirection, - :reset_terminus_class => nil) - instance.stubs(:indirection).returns indirection - instance - end - - it "should be able to return a list of indirections" do - Puppet::Face::Indirector.indirections.should be_include("catalog") - end - - it "should be able to return a list of terminuses for a given indirection" do - Puppet::Face::Indirector.terminus_classes(:catalog).should be_include("compiler") - end - - describe "as an instance" do - it "should be able to determine its indirection" do - # Loading actions here an get, um, complicated - Puppet::Face.stubs(:load_actions) - Puppet::Face::Indirector.new(:catalog, '0.0.1').indirection.should equal(Puppet::Resource::Catalog.indirection) - end - end - - [:find, :search, :save, :destroy].each do |method| - it "should define a '#{method}' action" do - Puppet::Face::Indirector.should be_action(method) - end - - it "should call the indirection method with options when the '#{method}' action is invoked" do - subject.indirection.expects(method).with(:test, {}) - subject.send(method, :test) - end - it "should forward passed options" do - subject.indirection.expects(method).with(:test, {'one'=>'1'}) - subject.send(method, :test, {'one'=>'1'}) - end - end - - it "should be able to override its indirection name" do - subject.set_indirection_name :foo - subject.indirection_name.should == :foo - end - - it "should be able to set its terminus class" do - subject.indirection.expects(:terminus_class=).with(:myterm) - subject.set_terminus(:myterm) - end - - it "should define a class-level 'info' action" do - Puppet::Face::Indirector.should be_action(:info) - end -end |
