Class: Spec::DSL::ExampleMatcher
- Defined in:
- lib/spec/dsl/example_matcher.rb
Instance Attribute Summary collapse
-
#example_desc ⇒ Object
writeonly
Sets the attribute example_desc.
Instance Method Summary collapse
-
#initialize(behaviour_desc, example_desc = nil) ⇒ ExampleMatcher
constructor
A new instance of ExampleMatcher.
- #matches?(specified_examples) ⇒ Boolean
Constructor Details
#initialize(behaviour_desc, example_desc = nil) ⇒ ExampleMatcher
Returns a new instance of ExampleMatcher.
6 7 8 9 |
# File 'lib/spec/dsl/example_matcher.rb', line 6 def initialize(behaviour_desc, example_desc=nil) @behaviour_desc = behaviour_desc @example_desc = example_desc end |
Instance Attribute Details
#example_desc=(value) ⇒ Object (writeonly)
Sets the attribute example_desc
5 6 7 |
# File 'lib/spec/dsl/example_matcher.rb', line 5 def example_desc=(value) @example_desc = value end |
Instance Method Details
#matches?(specified_examples) ⇒ Boolean
11 12 13 14 15 16 |
# File 'lib/spec/dsl/example_matcher.rb', line 11 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 |