Class: XCPretty::Formatter
- Inherits:
-
Object
- Object
- XCPretty::Formatter
- Includes:
- ANSI, FormatMethods
- Defined in:
- lib/xcpretty/formatters/formatter.rb
Constant Summary
Constants included from FormatMethods
XCPretty::FormatMethods::EMPTY_STRING
Constants included from ANSI
ANSI::COLORS, ANSI::EFFECT, ANSI::FORMATTED_MATCHER
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Attributes included from ANSI
Instance Method Summary collapse
-
#format_test_summary(executed_message, failures_per_suite) ⇒ Object
Will be printed by default.
-
#initialize(use_unicode, colorize) ⇒ Formatter
constructor
A new instance of Formatter.
-
#optional_newline ⇒ Object
If you want to print inline, override #optional_newline with ”.
-
#pretty_format(text) ⇒ Object
Override if you want to catch something specific with your regex.
- #use_unicode? ⇒ Boolean
Methods included from FormatMethods
#format_analyze, #format_build_target, #format_check_dependencies, #format_clean, #format_clean_remove, #format_clean_target, #format_codesign, #format_compile, #format_compile_error, #format_compile_xib, #format_copy_strings_file, #format_cpresource, #format_error, #format_failing_test, #format_generate_dsym, #format_libtool, #format_linking, #format_passing_test, #format_pbxcp, #format_phase_script_execution, #format_preprocess, #format_process_info_plist, #format_process_pch, #format_test_run_finished, #format_test_run_started, #format_test_suite_started
Methods included from ANSI
#ansi_parse, #applied_effects, #colorize?, #cyan, #green, #red, #strip, #white, #yellow
Constructor Details
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
44 45 46 |
# File 'lib/xcpretty/formatters/formatter.rb', line 44 def parser @parser end |
Instance Method Details
#format_test_summary(executed_message, failures_per_suite) ⇒ Object
Will be printed by default. Override with ” if you don’t want summary
67 68 69 70 71 72 73 |
# File 'lib/xcpretty/formatters/formatter.rb', line 67 def format_test_summary(, failures_per_suite) failures = format_failures(failures_per_suite) = failures.empty? ? green() : red() text = [failures, ].join("\n\n\n").strip "\n\n#{text}" end |
#optional_newline ⇒ Object
If you want to print inline, override #optional_newline with ”
58 59 60 |
# File 'lib/xcpretty/formatters/formatter.rb', line 58 def optional_newline "\n" end |
#pretty_format(text) ⇒ Object
Override if you want to catch something specific with your regex
53 54 55 |
# File 'lib/xcpretty/formatters/formatter.rb', line 53 def pretty_format(text) parser.parse(text) end |
#use_unicode? ⇒ Boolean
62 63 64 |
# File 'lib/xcpretty/formatters/formatter.rb', line 62 def use_unicode? !!@use_unicode end |