Class: TM::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/tm/table.rb

Class Method Summary collapse

Class Method Details

.[](test_file, name) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/tm/table.rb', line 3

def self.[] test_file, name
  parse_format = TM::Configuration.config['table_format'] || 'plain_text'
  table_file = test_file.sub(/_spec\.rb$/,'').sub(/^#{TM::Configuration.root}\/features\//,'')
  ## constantize: plain_text => PlainText
  parse_format = parse_format.capitalize.gsub(/_(\w)/) { $1.capitalize }
  return TM::Parse.const_get(parse_format)[table_file, name.strip]
end