Class: Spec::Example::ExampleMatcher

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

Instance Method Summary collapse

Constructor Details

#initialize(example_group_description, example_name) ⇒ ExampleMatcher

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

#matches?(specified_examples) ⇒ Boolean

Returns:

  • (Boolean)


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

def matches?(specified_examples)
  specified_examples.each do |specified_example|
    return true if matches_literal_example?(specified_example) || matches_example_not_considering_modules?(specified_example)
  end
  false
end