diff options
| author | Luke Kanies <luke@puppetlabs.com> | 2011-02-22 23:49:01 -0800 |
|---|---|---|
| committer | Luke Kanies <luke@puppetlabs.com> | 2011-02-22 23:49:01 -0800 |
| commit | 4fa54d02a2806e8fde54da9bb7e4d6735b3cffe4 (patch) | |
| tree | 71ac52c4fadb9617fc8f8925b682b3ac9e832c26 /spec/unit | |
| parent | bec807e5a12e24c11aedb40a997b154f1bed62c0 (diff) | |
| download | puppet-4fa54d02a2806e8fde54da9bb7e4d6735b3cffe4.tar.gz puppet-4fa54d02a2806e8fde54da9bb7e4d6735b3cffe4.tar.xz puppet-4fa54d02a2806e8fde54da9bb7e4d6735b3cffe4.zip | |
Adding render and exit_code override support
This is mostly in response to feature requests from
Dan.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'spec/unit')
| -rw-r--r-- | spec/unit/application/interface_base_spec.rb | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/unit/application/interface_base_spec.rb b/spec/unit/application/interface_base_spec.rb index ca1353d28..c20be1142 100644 --- a/spec/unit/application/interface_base_spec.rb +++ b/spec/unit/application/interface_base_spec.rb @@ -2,8 +2,35 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') require 'puppet/application/interface_base' +require 'puppet/application/interface_base' + +base_interface = Puppet::Interface.new(:basetest) +class Puppet::Application::InterfaceBase::Basetest < Puppet::Application::InterfaceBase +end describe Puppet::Application::InterfaceBase do - describe "during setup" do + before do + @app = Puppet::Application::InterfaceBase::Basetest.new + @app.stubs(:exit) + @app.stubs(:puts) + end + + describe "when calling main" do + before do + @app.verb = :find + @app.name = "myname" + @app.arguments = "myarg" + @app.interface.stubs(:find) + end + + it "should send the specified verb and name to the interface" do + @app.interface.expects(:find).with("myname", "myarg") + + @app.main + end + + it "should use its render method to render any result" + + it "should exit with the current exit code" end end |
