Created
May 14, 2010 16:54
-
-
Save msassak/401375 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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