Class: Megatest::Selector::NameFilter
- Inherits:
-
Object
- Object
- Megatest::Selector::NameFilter
- Defined in:
- lib/megatest/selector.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ NameFilter
constructor
A new instance of NameFilter.
- #select(test_cases) ⇒ Object
Constructor Details
#initialize(name) ⇒ NameFilter
Returns a new instance of NameFilter.
228 229 230 |
# File 'lib/megatest/selector.rb', line 228 def initialize(name) @name = name end |
Class Method Details
.parse(arg) ⇒ Object
221 222 223 224 225 |
# File 'lib/megatest/selector.rb', line 221 def parse(arg) if match = arg.match(/\A#(.+)\z/) new(match[1]) end end |
Instance Method Details
#select(test_cases) ⇒ Object
232 233 234 235 236 |
# File 'lib/megatest/selector.rb', line 232 def select(test_cases) test_cases.select do |t| @name == t.name || @name == t.id end end |