summaryrefslogtreecommitdiffstats
path: root/spec/unit/face
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-02 15:36:30 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-02 15:36:30 -0700
commitd4df6cc2274e119fb2a67bca0912667b0fef7866 (patch)
tree8c5bd026ecf070fa404623a4b658de296342a5ad /spec/unit/face
parent8b28417f696bd7d34ea4212a89913b5e796993c7 (diff)
parent1b42725b5caab6f8e457e11fec2488fbe94e8e43 (diff)
Merge branch 'bug/2.7.x/7314-backtrace-when-face-has-syntax-error' into 2.7.x
Diffstat (limited to 'spec/unit/face')
-rwxr-xr-xspec/unit/face/indirector_spec.rb59
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