Sha256: c14c63df14f2025c986d4606dd99407caf50c9d56da1b13e5503da456ddaf192

Contents?: true

Size: 1.06 KB

Versions: 144

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'
require 'puppet/application/help'

describe "puppet help" do
  let(:app) { Puppet::Application[:help] }

  it "generates global help" do
    expect {
      app.run
    }.to exit_with(0)
     .and output(Regexp.new(Regexp.escape(<<~END), Regexp::MULTILINE)).to_stdout

       Usage: puppet <subcommand> [options] <action> [options]

       Available subcommands:
     END
  end

  Puppet::Face.faces.sort.each do |face_name|
    next if face_name == :key

    context "for #{face_name}" do
      it "generates help" do
        app.command_line.args = ['help', face_name]

        expect {
          app.run
        }.to exit_with(0)
         .and output(/USAGE: puppet #{face_name} <action>/).to_stdout
      end

      Puppet::Face[face_name, :current].actions.sort.each do |action_name|
        it "for action #{action_name}" do
          app.command_line.args = ['help', face_name, action_name]

          expect {
            app.run
          }.to exit_with(0)
           .and output(/USAGE: puppet #{face_name}/).to_stdout
        end
      end
    end
  end
end

Version data entries

144 entries across 144 versions & 1 rubygems

Version Path
puppet-7.0.0 spec/integration/application/help_spec.rb
puppet-7.0.0-x86-mingw32 spec/integration/application/help_spec.rb
puppet-7.0.0-x64-mingw32 spec/integration/application/help_spec.rb
puppet-7.0.0-universal-darwin spec/integration/application/help_spec.rb