Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move data table scenario to TCK

Also add the support code for running that scenario with Cucumber-ruby
  • Loading branch information...
commit 6c0761bbba45dc3d03aaabba45f49af812776554 1 parent 9b71eea
@jbpros jbpros authored
2  features/cucumber-tck
@@ -1 +1 @@
-Subproject commit 0f42d85e17c1bbfa6da76960fc40985db69e49bd
+Subproject commit 7ea91477edd14180ded92f7699d09689227644cd
View
17 features/data_table_rows.feature
@@ -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" ]
- ]
- """
View
10 features/step_definitions/cucumber_js_mappings.rb
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.