Class: Spec::Example::ExampleMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/example/example_matcher.rb

Instance Method Summary (collapse)

Constructor Details

- (ExampleMatcher) initialize(example_group_description, example_name)

Returns a new instance of ExampleMatcher



4
5
6
7
# File 'lib/spec/example/example_matcher.rb', line 4

def initialize(example_group_description, example_name)
  @example_group_description = example_group_description
  @example_name = example_name
end

Instance Method Details

- (Boolean) matches?(specified_examples)

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/spec/example/example_matcher.rb', line 9

def matches?(specified_examples)
  specified_examples.any? do |specified_example|
    matches_literal_example?(specified_example) || matches_example_not_considering_modules?(specified_example)
  end
end