Module: Daddy::Cucumber::Table

Defined in:
lib/daddy/cucumber/helpers/table.rb

Instance Method Summary collapse

Instance Method Details

#normalize_table(ast_table) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/daddy/cucumber/helpers/table.rb', line 4

def normalize_table(ast_table)
  ret = []

  ast_table.raw.each do |ast_row|
    row = []

    ast_row.each do |ast_col|
      value = ast_col.gsub(/^[ \s]*(.*?)[ \s]*$/, '\1')
      row << value
    end

    ret << row
  end

  ret
end