Class: Inspec::Reporters::CLI

Inherits:
Base
  • Object
show all
Defined in:
lib/inspec/reporters/cli.rb

Defined Under Namespace

Classes: Control

Constant Summary collapse

MULTI_TEST_CONTROL_SUMMARY_MAX_LEN =
60

Instance Attribute Summary

Attributes inherited from Base

#run_data

Instance Method Summary collapse

Methods inherited from Base

#initialize, #output, #rendered_output

Constructor Details

This class inherits a constructor from Inspec::Reporters::Base

Instance Method Details

#renderObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/inspec/reporters/cli.rb', line 45

def render
  run_data[:profiles].each do |profile|
    if profile[:status] == 'skipped'
      platform = run_data[:platform]
      output("Skipping profile: '#{profile[:name]}' on unsupported platform: '#{platform[:name]}/#{platform[:release]}'.")
      next
    end
    @control_count = 0
    output('')
    print_profile_header(profile)
    print_standard_control_results(profile)
    print_anonymous_control_results(profile)
    output(format_message(
             indentation: 5,
             message: 'No tests executed.',
    )) if @control_count == 0
  end

  output('')
  print_profile_summary
  print_tests_summary
end