diff options
author | Nick Lewis <nick@puppetlabs.com> | 2011-06-08 18:41:16 -0700 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2011-06-08 18:41:16 -0700 |
commit | 8ccd00963d91f168438eaec4b29a18cd4a1ac583 (patch) | |
tree | 85e15c5ef9390454438fb300c5baa38a7f2f5f3e /spec/unit/interface/documentation_spec.rb | |
parent | 376e0f04af01810d00eede4de52744bb8c8e1681 (diff) | |
parent | d4c499dfdbd94f5272278e1ba87a75915607c3d7 (diff) | |
download | puppet-8ccd00963d91f168438eaec4b29a18cd4a1ac583.tar.gz puppet-8ccd00963d91f168438eaec4b29a18cd4a1ac583.tar.xz puppet-8ccd00963d91f168438eaec4b29a18cd4a1ac583.zip |
Merge branch '2.7rc' into 2.7.x
Diffstat (limited to 'spec/unit/interface/documentation_spec.rb')
-rwxr-xr-x | spec/unit/interface/documentation_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/unit/interface/documentation_spec.rb b/spec/unit/interface/documentation_spec.rb new file mode 100755 index 000000000..6865b9073 --- /dev/null +++ b/spec/unit/interface/documentation_spec.rb @@ -0,0 +1,34 @@ +#!/usr/bin/env rspec +require 'spec_helper' +require 'puppet/interface' +require 'puppet/interface/option' +require 'puppet/interface/documentation' + +class Puppet::Interface::TinyDocs::Test + include Puppet::Interface::TinyDocs + attr_accessor :name, :options + def initialize + self.name = "tinydoc-test" + self.options = [] + end + + def get_option(name) + Puppet::Interface::Option.new(nil, "--#{name}") + end +end + +describe Puppet::Interface::TinyDocs do + subject { Puppet::Interface::TinyDocs::Test.new } + + context "#build_synopsis" do + before :each do + subject.options = [:foo, :bar] + end + + it { should respond_to :build_synopsis } + + it "should put a space between options (#7828)" do + subject.build_synopsis('baz').should =~ /#{Regexp.quote('[--foo] [--bar]')}/ + end + end +end |