Sha256: a6cbea465a6cec19b3a80ebc193b6149627f90c5736a60eab59d7c3e21f271b7

Contents?: true

Size: 941 Bytes

Versions: 192

Compression:

Stored size: 941 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'
require 'puppet/face'

describe Puppet::Face[:man, :current] do
  let(:pager) { '/path/to/our/pager' }

  around do |example|
    oldpager = ENV['MANPAGER']
    ENV['MANPAGER'] = pager
    example.run
    ENV['MANPAGER'] = oldpager
  end

  it "exits with 0 when generating man documentation for each available application" do
    Puppet::Util.stubs(:which).with('ronn').returns(nil)
    Puppet::Util.stubs(:which).with(pager).returns(pager)

    Puppet::Application.available_application_names.each do |name|
      next if %w{man face_base indirection_base}.include? name

      klass = Puppet::Application.find('man')
      app = klass.new(Puppet::Util::CommandLine.new('puppet', ['man', name]))

      expect do
        IO.stubs(:popen).with(pager, 'w:UTF-8').yields($stdout)

        expect { app.run }.to exit_with(0)
      end.to_not have_printed(/undefined method `gsub'/)
    end
  end
end

Version data entries

192 entries across 192 versions & 1 rubygems

Version Path
puppet-4.9.2 spec/unit/man_spec.rb
puppet-4.9.2-x86-mingw32 spec/unit/man_spec.rb
puppet-4.9.2-x64-mingw32 spec/unit/man_spec.rb
puppet-4.9.2-universal-darwin spec/unit/man_spec.rb
puppet-4.9.1 spec/unit/man_spec.rb
puppet-4.9.1-x86-mingw32 spec/unit/man_spec.rb
puppet-4.9.1-x64-mingw32 spec/unit/man_spec.rb
puppet-4.9.1-universal-darwin spec/unit/man_spec.rb
puppet-4.9.0 spec/unit/man_spec.rb
puppet-4.9.0-x86-mingw32 spec/unit/man_spec.rb
puppet-4.9.0-x64-mingw32 spec/unit/man_spec.rb
puppet-4.9.0-universal-darwin spec/unit/man_spec.rb