Class: Megatest::Selector::NameFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/megatest/selector.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ NameFilter

Returns a new instance of NameFilter.



215
216
217
# File 'lib/megatest/selector.rb', line 215

def initialize(name)
  @name = name
end

Class Method Details

.parse(arg) ⇒ Object



208
209
210
211
212
# File 'lib/megatest/selector.rb', line 208

def parse(arg)
  if match = arg.match(/\A#(.+)\z/)
    new(match[1])
  end
end

Instance Method Details

#select(test_cases) ⇒ Object



219
220
221
222
223
# File 'lib/megatest/selector.rb', line 219

def select(test_cases)
  test_cases.select do |t|
    @name == t.name || @name == t.id
  end
end