Method: InspecRspecCli#close

Defined in:
lib/inspec/rspec_json_formatter.rb

#close(_notification) ⇒ Object

This is the last method is invoked through the formatter interface. Because the profile we may have some remaining anonymous examples so we want to display them as well as a summary of the profile and test stats.



383
384
385
386
387
388
389
390
391
392
# File 'lib/inspec/rspec_json_formatter.rb', line 383

def close(_notification)
  # when the profile has no controls or examples it will not have been printed.
  # then we want to ensure we print all the profiles
  print_last_control_with_examples unless last_control_is_anonymous?
  output.puts ''
  print_anonymous_examples_associated_with_last_profile
  print_profiles_without_examples
  print_profile_summary
  print_tests_summary
end