Permalink
Browse files

Move data table scenario to TCK

Also add the support code for running that scenario with Cucumber-ruby
  • Loading branch information...
1 parent 9b71eea commit 6c0761bbba45dc3d03aaabba45f49af812776554 @jbpros jbpros committed Nov 13, 2012
Showing with 11 additions and 18 deletions.
  1. +1 −1 features/cucumber-tck
  2. +0 −17 features/data_table_rows.feature
  3. +10 −0 features/step_definitions/cucumber_js_mappings.rb
@@ -1,17 +0,0 @@
-Feature: Data Tables
-
- Scenario: a data table can be read as an array of values
- Given the following data table in a step:
- """
- | Latin | English |
- | Cucumis sativus | Cucumber |
- | Cucumis anguria | Burr Gherkin |
- """
- When the data table is passed to a step mapping that gets the row arrays without the header
- Then the data table is converted to the following:
- """
- [
- [ "Cucumis sativus", "Cucumber" ],
- [ "Cucumis anguria", "Burr Gherkin" ]
- ]
- """
@@ -107,6 +107,16 @@ def write_mapping_receiving_data_table_as_hashes(step_name)
append_step_definition(step_name, body, ["dataTable"])
end
+ def write_mapping_receiving_data_table_as_headless_row_array(step_name)
+ body = <<-EOF
+var dataTableHashes = dataTable.rows();
+var dataTableJSON = JSON.stringify(dataTableHashes);
+fs.writeFileSync("#{DATA_TABLE_LOG_FILE}", "" + dataTableJSON);
+callback();
+EOF
+ append_step_definition(step_name, body, ["dataTable"])
+ end
+
def write_calculator_code
rpn_calculator_code = get_file_contents('../support/rpn_calculator.js')
create_dir 'features/support'

0 comments on commit 6c0761b

Please sign in to comment.