Class Spec::Runner::Formatter::NestedTextFormatter

  1. lib/spec/runner/formatter/nested_text_formatter.rb

Public class methods

new (options, where)
[show source]
# File lib/spec/runner/formatter/nested_text_formatter.rb, line 7
        def initialize(options, where)
          super
          @last_nested_descriptions = []
        end

Public instance methods

add_example_group (example_group)
[show source]
# File lib/spec/runner/formatter/nested_text_formatter.rb, line 12
        def add_example_group(example_group)
          super

          example_group.nested_descriptions.each_with_index do |nested_description, i|
            unless nested_description == @last_nested_descriptions[i]
              output.puts "#{'  ' * i}#{nested_description}"
            end
          end

          @last_nested_descriptions = example_group.nested_descriptions
        end
current_indentation ()
[show source]
# File lib/spec/runner/formatter/nested_text_formatter.rb, line 41
        def current_indentation
          '  ' * @last_nested_descriptions.length
        end
example_failed (example, counter, failure)
[show source]
# File lib/spec/runner/formatter/nested_text_formatter.rb, line 24
        def example_failed(example, counter, failure)
          output.puts(red("#{current_indentation}#{example.description} (FAILED - #{counter})"))
          output.flush
        end
example_passed (example)
[show source]
# File lib/spec/runner/formatter/nested_text_formatter.rb, line 29
        def example_passed(example)
          message = "#{current_indentation}#{example.description}"
          output.puts green(message)
          output.flush
        end
example_pending (example, message, pending_caller)
[show source]
# File lib/spec/runner/formatter/nested_text_formatter.rb, line 35
        def example_pending(example, message, pending_caller)
          super
          output.puts yellow("#{current_indentation}#{example.description} (PENDING: #{message})")
          output.flush
        end