Sha256: 4efe707afc604ee7ed1cacd0cddfb8bfa9af48c2f31f8a01df1df101103594a1

Contents?: true

Size: 885 Bytes

Versions: 4

Compression:

Stored size: 885 Bytes

Contents

#! /usr/bin/env ruby -S 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, :display_global_options
  def initialize
    self.name    = "tinydoc-test"
    self.options = []
    self.display_global_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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-3.0.0.rc8 spec/unit/interface/documentation_spec.rb
puppet-3.0.0.rc7 spec/unit/interface/documentation_spec.rb
puppet-3.0.0.rc5 spec/unit/interface/documentation_spec.rb
puppet-3.0.0.rc4 spec/unit/interface/documentation_spec.rb