diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/unit/application/config_spec.rb | 10 | ||||
| -rw-r--r-- | spec/unit/interface/config_spec.rb | 27 |
2 files changed, 37 insertions, 0 deletions
diff --git a/spec/unit/application/config_spec.rb b/spec/unit/application/config_spec.rb new file mode 100644 index 000000000..3d894a89c --- /dev/null +++ b/spec/unit/application/config_spec.rb @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') +require 'puppet/application/config' + +describe Puppet::Application::Config do + it "should be a subclass of Puppet::Application::InterfaceBase" do + Puppet::Application::Config.superclass.should equal(Puppet::Application::InterfaceBase) + end +end 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 |
