summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xspec/unit/interface_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/interface_spec.rb b/spec/unit/interface_spec.rb
index ea11b21ba..b25d06f51 100755
--- a/spec/unit/interface_spec.rb
+++ b/spec/unit/interface_spec.rb
@@ -1,3 +1,4 @@
+require 'spec_helper'
require 'puppet/faces'
require 'puppet/interface'
@@ -16,6 +17,20 @@ describe Puppet::Interface do
Puppet::Interface::FaceCollection.instance_variable_set("@faces", @faces)
end
+ describe "#[]" do
+ it "should fail when no version is requested" do
+ expect { subject[:huzzah] }.should raise_error ArgumentError
+ end
+
+ it "should raise an exception when the requested version is unavailable" do
+ expect { subject[:huzzah, '17.0.0'] }.should raise_error, Puppet::Error
+ end
+
+ it "should raise an exception when the requested face doesn't exist" do
+ expect { subject[:burrble_toot, :current] }.should raise_error, Puppet::Error
+ end
+ end
+
describe "#define" do
it "should register the face" do
face = subject.define(:face_test_register, '0.0.1')