summaryrefslogtreecommitdiffstats
path: root/spec/unit/interface_spec.rb
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-03-26 00:12:17 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-03-28 10:45:34 -0700
commitb859baa04737644e40002f511c5941d002a956e3 (patch)
treef8f4d581c3b0445df836d5e55945f62547239598 /spec/unit/interface_spec.rb
parent88aeb04a50d8997b5e1e0ed7a5a2239508b174ee (diff)
downloadpuppet-b859baa04737644e40002f511c5941d002a956e3.tar.gz
puppet-b859baa04737644e40002f511c5941d002a956e3.tar.xz
puppet-b859baa04737644e40002f511c5941d002a956e3.zip
MAINT: the API is officially named "string" as of this moment.
Now that we have settled on the final public name for the API, "Puppet::String", mass-rename and mass-edit all the files to follow. Reviewed-By: Randall Hansen <randall@puppetlabs.com>
Diffstat (limited to 'spec/unit/interface_spec.rb')
-rwxr-xr-xspec/unit/interface_spec.rb83
1 files changed, 0 insertions, 83 deletions
diff --git a/spec/unit/interface_spec.rb b/spec/unit/interface_spec.rb
deleted file mode 100755
index cf7d209da..000000000
--- a/spec/unit/interface_spec.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
-
-describe Puppet::Interface do
- before :all do
- @interfaces = Puppet::Interface::InterfaceCollection.instance_variable_get("@interfaces").dup
- end
-
- before :each do
- Puppet::Interface::InterfaceCollection.instance_variable_get("@interfaces").clear
- end
-
- after :all do
- Puppet::Interface::InterfaceCollection.instance_variable_set("@interfaces", @interfaces)
- end
-
- describe "#define" do
- it "should register the interface" do
- interface = Puppet::Interface.define(:interface_test_register, '0.0.1')
- interface.should == Puppet::Interface[:interface_test_register, '0.0.1']
- end
-
- it "should load actions" do
- Puppet::Interface.any_instance.expects(:load_actions)
- Puppet::Interface.define(:interface_test_load_actions, '0.0.1')
- end
-
- it "should require a version number" do
- proc { Puppet::Interface.define(:no_version) }.should raise_error(ArgumentError)
- end
- end
-
- describe "#initialize" do
- it "should require a version number" do
- proc { Puppet::Interface.new(:no_version) }.should raise_error(ArgumentError)
- end
-
- it "should require a valid version number" do
- proc { Puppet::Interface.new(:bad_version, 'Rasins') }.should raise_error(ArgumentError)
- end
-
- it "should instance-eval any provided block" do
- face = Puppet::Interface.new(:interface_test_block,'0.0.1') do
- action(:something) do
- invoke { "foo" }
- end
- end
-
- face.something.should == "foo"
- end
- end
-
- it "should have a name" do
- Puppet::Interface.new(:me,'0.0.1').name.should == :me
- end
-
- it "should stringify with its own name" do
- Puppet::Interface.new(:me,'0.0.1').to_s.should =~ /\bme\b/
- end
-
- it "should allow overriding of the default format" do
- face = Puppet::Interface.new(:me,'0.0.1')
- face.set_default_format :foo
- face.default_format.should == :foo
- end
-
- it "should default to :pson for its format" do
- Puppet::Interface.new(:me, '0.0.1').default_format.should == :pson
- end
-
- # Why?
- it "should create a class-level autoloader" do
- Puppet::Interface.autoloader.should be_instance_of(Puppet::Util::Autoload)
- end
-
- it "should try to require interfaces that are not known" do
- Puppet::Interface::InterfaceCollection.expects(:require).with "puppet/interface/v0.0.1/foo"
- Puppet::Interface[:foo, '0.0.1']
- end
-
- it "should be able to load all actions in all search paths"
-end