summaryrefslogtreecommitdiffstats
path: root/spec/unit/application
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/application')
-rwxr-xr-xspec/unit/application/config_spec.rb4
-rwxr-xr-xspec/unit/application/face_base_spec.rb (renamed from spec/unit/application/faces_base_spec.rb)18
-rwxr-xr-xspec/unit/application/faces_spec.rb5
-rwxr-xr-xspec/unit/application/indirection_base_spec.rb6
4 files changed, 16 insertions, 17 deletions
diff --git a/spec/unit/application/config_spec.rb b/spec/unit/application/config_spec.rb
index 0c1279630..fb224eac6 100755
--- a/spec/unit/application/config_spec.rb
+++ b/spec/unit/application/config_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
require 'puppet/application/config'
describe Puppet::Application::Config do
- it "should be a subclass of Puppet::Application::FacesBase" do
- Puppet::Application::Config.superclass.should equal(Puppet::Application::FacesBase)
+ it "should be a subclass of Puppet::Application::FaceBase" do
+ Puppet::Application::Config.superclass.should equal(Puppet::Application::FaceBase)
end
end
diff --git a/spec/unit/application/faces_base_spec.rb b/spec/unit/application/face_base_spec.rb
index 18bd30295..d09e00a32 100755
--- a/spec/unit/application/faces_base_spec.rb
+++ b/spec/unit/application/face_base_spec.rb
@@ -1,15 +1,15 @@
#!/usr/bin/env rspec
require 'spec_helper'
-require 'puppet/application/faces_base'
+require 'puppet/application/face_base'
require 'tmpdir'
-class Puppet::Application::FacesBase::Basetest < Puppet::Application::FacesBase
+class Puppet::Application::FaceBase::Basetest < Puppet::Application::FaceBase
end
-describe Puppet::Application::FacesBase do
+describe Puppet::Application::FaceBase do
before :all do
- Puppet::Faces.define(:basetest, '0.0.1') do
+ Puppet::Face.define(:basetest, '0.0.1') do
option("--[no-]boolean")
option("--mandatory MANDATORY")
option("--optional [OPTIONAL]")
@@ -22,7 +22,7 @@ describe Puppet::Application::FacesBase do
end
let :app do
- app = Puppet::Application::FacesBase::Basetest.new
+ app = Puppet::Application::FaceBase::Basetest.new
app.command_line.stubs(:subcommand_name).returns('subcommand')
Puppet::Util::Log.stubs(:newdestination)
app
@@ -57,11 +57,11 @@ describe Puppet::Application::FacesBase do
app.parse_options
end
- it "should set the faces based on the type" do
+ it "should set the face based on the type" do
app.face.name.should == :basetest
end
- it "should set the format based on the faces default" do
+ it "should set the format based on the face default" do
app.format.should == :pson
end
@@ -168,13 +168,13 @@ describe Puppet::Application::FacesBase do
before :each do
app.expects(:exit).with(0)
- app.face = Puppet::Faces[:basetest, '0.0.1']
+ app.face = Puppet::Face[:basetest, '0.0.1']
app.action = app.face.get_action(:foo)
app.format = :pson
app.arguments = ["myname", "myarg"]
end
- it "should send the specified verb and name to the faces" do
+ it "should send the specified verb and name to the face" do
app.face.expects(:foo).with(*app.arguments)
app.main
end
diff --git a/spec/unit/application/faces_spec.rb b/spec/unit/application/faces_spec.rb
index c4d15a297..9b6f073f5 100755
--- a/spec/unit/application/faces_spec.rb
+++ b/spec/unit/application/faces_spec.rb
@@ -9,8 +9,7 @@ describe Puppet::Application::Faces do
end
it "should always call 'list'" do
- faces = Puppet::Application::Faces.new
- faces.expects(:list)
- faces.main
+ subject.expects(:list)
+ subject.main
end
end
diff --git a/spec/unit/application/indirection_base_spec.rb b/spec/unit/application/indirection_base_spec.rb
index 98eb3a118..9aac36860 100755
--- a/spec/unit/application/indirection_base_spec.rb
+++ b/spec/unit/application/indirection_base_spec.rb
@@ -2,19 +2,19 @@
require 'spec_helper'
require 'puppet/application/indirection_base'
-require 'puppet/faces/indirector'
+require 'puppet/face/indirector'
########################################################################
# Stub for testing; the names are critical, sadly. --daniel 2011-03-30
class Puppet::Application::TestIndirection < Puppet::Application::IndirectionBase
end
-face = Puppet::Faces::Indirector.define(:testindirection, '0.0.1') do
+face = Puppet::Face::Indirector.define(:testindirection, '0.0.1') do
end
# REVISIT: This horror is required because we don't allow anything to be
# :current except for if it lives on, and is loaded from, disk. --daniel 2011-03-29
face.instance_variable_set('@version', :current)
-Puppet::Faces.register(face)
+Puppet::Face.register(face)
########################################################################