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.
230 231 232 |
# File 'lib/megatest/selector.rb', line 230 def initialize(name) @name = name end |
Class Method Details
.parse(arg) ⇒ Object
223 224 225 226 227 |
# File 'lib/megatest/selector.rb', line 223 def parse(arg) if match = arg.match(/\A#(.+)\z/) new(match[1]) end end |
Instance Method Details
#select(test_cases) ⇒ Object
234 235 236 237 238 |
# File 'lib/megatest/selector.rb', line 234 def select(test_cases) test_cases.select do |t| @name == t.name || @name == t.id end end |