Module: Flutter::RSpec::ClassMethods

Included in:
RSpec::Core::ExampleGroup
Defined in:
lib/flutter/rspec.rb

Instance Method Summary collapse

Instance Method Details

#filtered_examplesObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/flutter/rspec.rb', line 20

def filtered_examples
  return super unless Flutter.enabled

  Flutter::RSpec.filtered ||= Set.new
  Flutter::RSpec.total ||= Set.new
  Flutter::RSpec.tracker.reset! if Flutter.enabled && Flutter.config.reset_storage

  original = super
  Flutter::RSpec.total.merge(original)
  return original unless Flutter.enabled

  original.select do |example|
    !(example.[:block] && Flutter::RSpec.tracker.skip?(
      example.full_description,
      example.[:absolute_file_path],
      example.[:block].source,
    ).tap { |skip| Flutter::RSpec.filtered << example if skip })
  end
end