Class: Spec::Runner::SpecMatcher
- Defined in:
- lib/spec/runner/spec_matcher.rb
Instance Attribute Summary collapse
-
#spec_desc ⇒ Object
writeonly
Sets the attribute spec_desc.
Instance Method Summary collapse
-
#initialize(context_desc, spec_desc = nil) ⇒ SpecMatcher
constructor
A new instance of SpecMatcher.
- #matches?(desc) ⇒ Boolean
Constructor Details
#initialize(context_desc, spec_desc = nil) ⇒ SpecMatcher
Returns a new instance of SpecMatcher.
6 7 8 9 |
# File 'lib/spec/runner/spec_matcher.rb', line 6 def initialize(context_desc, spec_desc=nil) @context_desc = context_desc @spec_desc = spec_desc end |
Instance Attribute Details
#spec_desc=(value) ⇒ Object (writeonly)
Sets the attribute spec_desc
5 6 7 |
# File 'lib/spec/runner/spec_matcher.rb', line 5 def spec_desc=(value) @spec_desc = value end |
Instance Method Details
#matches?(desc) ⇒ Boolean
11 12 13 |
# File 'lib/spec/runner/spec_matcher.rb', line 11 def matches?(desc) desc =~ /(^#{context_regexp} #{spec_regexp}$|^#{context_regexp}$|^#{spec_regexp}$)/ end |