From 368210e8a8a35cf2cae509b1d357337f9958cdff Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 22 Feb 2011 17:38:04 -0800 Subject: Adding a simple "config" app Signed-off-by: Luke Kanies --- spec/unit/interface/config_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 spec/unit/interface/config_spec.rb (limited to 'spec/unit/interface') diff --git a/spec/unit/interface/config_spec.rb b/spec/unit/interface/config_spec.rb new file mode 100644 index 000000000..79c65f2ac --- /dev/null +++ b/spec/unit/interface/config_spec.rb @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby + +require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') +require 'puppet/interface/config' + +describe Puppet::Interface.interface(:config) do + before do + @interface = Puppet::Interface.interface(:config) + end + + it "should be a subclass of 'Indirection'" do + @interface.should be_instance_of(Puppet::Interface) + end + + it "should use Settings#print_config_options when asked to print" do + Puppet.settings.stubs(:puts) + Puppet.settings.expects(:print_config_options) + @interface.print + end + + it "should set 'configprint' to all desired values and call print_config_options when a specific value is provided" do + Puppet.settings.stubs(:puts) + Puppet.settings.expects(:print_config_options) + @interface.print("libdir", "ssldir") + Puppet.settings[:configprint].should == "libdir,ssldir" + end +end -- cgit