lib/cucumber/multiline_argument/data_table.rb in cucumber-2.0.2 vs lib/cucumber/multiline_argument/data_table.rb in cucumber-2.1.0
- old
+ new
@@ -1,7 +1,8 @@
require 'forwardable'
-require 'gherkin/formatter/escaping'
+require 'cucumber/gherkin/data_table_parser'
+require 'cucumber/gherkin/formatter/escaping'
require 'cucumber/core/ast/describes_itself'
module Cucumber
module MultilineArgument
# Step Definitions that match a plain text Step with a multiline argument table
@@ -35,11 +36,11 @@
def initialize
@rows = []
end
- def row(row, line_number)
+ def row(row)
@rows << row
end
def eof
end
@@ -71,12 +72,12 @@
end
private
def parse(text, location = Core::Ast::Location.of_caller)
builder = Builder.new
- lexer = Gherkin::Lexer::I18nLexer.new(builder)
- lexer.scan(text)
+ parser = Cucumber::Gherkin::DataTableParser.new(builder)
+ parser.parse(text)
from_array(builder.rows, location)
end
def from_array(data, location = Core::Ast::Location.of_caller)
new Core::Ast::DataTable.new(data, location)
@@ -637,10 +638,10 @@
end
# Represents a row of cells or columns of cells
class Cells #:nodoc:
include Enumerable
- include Gherkin::Formatter::Escaping
+ include Cucumber::Gherkin::Formatter::Escaping
attr_reader :exception
def initialize(table, cells)
@table, @cells = table, cells