Skip to content

Instantly share code, notes, and snippets.

@msassak
Created May 14, 2010 16:54
Show Gist options
  • Select an option

  • Save msassak/401375 to your computer and use it in GitHub Desktop.

Select an option

Save msassak/401375 to your computer and use it in GitHub Desktop.
class Cucumber::Ast::Table
def expand_dittos(ditto = "''")
ditto_rows = rows.dup
ditto_rows.each_cons(2) do |upper, lower|
next unless lower.any? { |cell| cell == ditto }
lower.each_with_index do |cell, idx|
lower[idx] = upper[idx] if cell == ditto
end
end
self.class.new([headers] + ditto_rows)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment