class SpecSelector

The SpecSelector instance receives example execution data from the reporter and arranges it into a formatted, navigable map.

Public Class Methods

new(output) click to toggle source
# File lib/spec_selector.rb, line 37
def initialize(output)
  @output = output
  hide_cursor
  initialize_all
end

Public Instance Methods

dump_summary(notification) click to toggle source
# File lib/spec_selector.rb, line 83
def dump_summary(notification)
  @example_count = notification.example_count
  @outside_errors_count = notification.errors_outside_of_examples_count
  errors_before_formatter_initialization
  print_errors(notification) if @outside_errors_count.positive?
  messages_only if @map.empty?
  examples_summary(notification)
end
example_failed(notification) click to toggle source
# File lib/spec_selector.rb, line 73
def example_failed(notification)
  clear_frame
  @failure_summaries[notification.example] = notification
  @failed << notification.example
  map_example(notification.example)
  check_inclusion_status(notification.example)
  @fail_count += 1
  status_count
end
example_group_started(notification) click to toggle source
# File lib/spec_selector.rb, line 47
def example_group_started(notification)
  group = notification.group
  map_group(group)
  @groups[group.metadata[:block]] = group
  check_inclusion_status(group)
end
example_passed(notification) click to toggle source
# File lib/spec_selector.rb, line 54
def example_passed(notification)
  clear_frame
  @passed << notification.example
  map_example(notification.example)
  check_inclusion_status(notification.example)
  @pass_count += 1
  status_count
end
example_pending(notification) click to toggle source
# File lib/spec_selector.rb, line 63
def example_pending(notification)
  clear_frame
  @pending_summaries[notification.example] = notification
  @pending << notification.example
  map_example(notification.example)
  check_inclusion_status(notification.example)
  @pending_count += 1
  status_count
end
message(notification) click to toggle source
# File lib/spec_selector.rb, line 43
def message(notification)
  @messages << notification.message
end