Class: Paraspec::RSpecFacade

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Singleton
Defined in:
lib/paraspec/rspec_facade.rb

Instance Method Summary collapse

Instance Method Details

#all_example_groupsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/paraspec/rspec_facade.rb', line 13

def all_example_groups
  @all_example_groups ||= begin
    groups = [] + RSpec.world.example_groups
    all_groups = []
    until groups.empty?
      new_groups = []
      groups.each do |group|
        all_groups << group
        new_groups += group.children
      end
      groups = new_groups
    end
    all_groups
  end
end

#all_examplesObject



29
30
31
32
33
34
35
36
# File 'lib/paraspec/rspec_facade.rb', line 29

def all_examples
  @all_examples ||= begin
    filter_manager = RSpec.configuration.filter_manager
    all_example_groups.map do |group|
      filter_manager.prune(group.examples)
    end.flatten
  end
end