class RSpec::Core::World

Internal container for global non-configuration data.
@api private

def all_example_groups

Other tags:
    Private: -
def all_example_groups
  FlatMap.flat_map(example_groups) { |g| g.descendants }
end

def all_examples

Other tags:
    Private: -
def all_examples
  FlatMap.flat_map(all_example_groups) { |g| g.examples }
end

def announce_exclusion_filter(announcements)

Other tags:
    Api: - private
def announce_exclusion_filter(announcements)
  return if exclusion_filter.empty?
  announcements << "exclude #{exclusion_filter.description}"
end

def announce_filters

Other tags:
    Api: - private
def announce_filters
  fail_if_config_and_cli_options_invalid
  filter_announcements = []
  announce_inclusion_filter filter_announcements
  announce_exclusion_filter filter_announcements
  unless filter_manager.empty?
    if filter_announcements.length == 1
      reporter.message("Run options: #{filter_announcements[0]}")
    else
      reporter.message("Run options:\n  #{filter_announcements.join("\n  ")}")
    end
  end
  if @configuration.run_all_when_everything_filtered? && example_count.zero? && !@configuration.only_failures?
    reporter.message("#{everything_filtered_message}; ignoring #{inclusion_filter.description}")
    filtered_examples.clear
    inclusion_filter.clear
  end
  return unless example_count.zero?
  example_groups.clear
  if filter_manager.empty?
    reporter.message("No examples found.")
  elsif exclusion_filter.empty? || inclusion_filter.empty?
    reporter.message(everything_filtered_message)
  end
end

def announce_inclusion_filter(announcements)

Other tags:
    Api: - private
def announce_inclusion_filter(announcements)
  return if inclusion_filter.empty?
  announcements << "include #{inclusion_filter.description}"
end

def declaration_line_numbers

def declaration_line_numbers
  @declaration_line_numbers ||= FlatMap.flat_map(example_groups, &:declaration_line_numbers)
end

def everything_filtered_message

Other tags:
    Private: -
def everything_filtered_message
  "\nAll examples were filtered out"
end

def example_count(groups=example_groups)

Other tags:
    Api: - private
def example_count(groups=example_groups)
  FlatMap.flat_map(groups) { |g| g.descendants }.
    inject(0) { |a, e| a + e.filtered_examples.size }
end

def exclusion_filter

Other tags:
    Private: -
def exclusion_filter
  @configuration.exclusion_filter
end

def fail_if_config_and_cli_options_invalid

def fail_if_config_and_cli_options_invalid
  return unless @configuration.only_failures_but_not_configured?
  reporter.abort_with(
    "\nTo use `--only-failures`, you must first set " \
    "`config.example_status_persistence_file_path`.",
    1 # exit code
  )
end

def filter_manager

Other tags:
    Private: -
def filter_manager
  @configuration.filter_manager
end

def inclusion_filter

Other tags:
    Private: -
def inclusion_filter
  @configuration.inclusion_filter
end

def initialize(configuration=RSpec.configuration)

def initialize(configuration=RSpec.configuration)
  @configuration = configuration
  @example_groups = []
  @example_group_counts_by_spec_file = Hash.new(0)
  @filtered_examples = Hash.new do |hash, group|
    hash[group] = filter_manager.prune(group.examples)
  end
end

def num_example_groups_defined_in(file)

Other tags:
    Private: -
def num_example_groups_defined_in(file)
  @example_group_counts_by_spec_file[file]
end

def ordered_example_groups

Other tags:
    Api: - private
def ordered_example_groups
  ordering_strategy = @configuration.ordering_registry.fetch(:global)
  ordering_strategy.order(@example_groups)
end

def preceding_declaration_line(filter_line)

Other tags:
    Api: - private
def preceding_declaration_line(filter_line)
  declaration_line_numbers.sort.inject(nil) do |highest_prior_declaration_line, line|
    line <= filter_line ? line : highest_prior_declaration_line
  end
end

def register(example_group)

Other tags:
    Api: - private
def register(example_group)
  example_groups << example_group
  @example_group_counts_by_spec_file[example_group.metadata[:file_path]] += 1
  example_group
end

def reporter

Other tags:
    Private: -
def reporter
  @configuration.reporter
end

def reset

Other tags:
    Api: - private
def reset
  example_groups.clear
  @shared_example_group_registry = nil
end

def shared_example_group_registry

Other tags:
    Private: -
def shared_example_group_registry
  @shared_example_group_registry ||= SharedExampleGroup::Registry.new
end