lib/cucumber/js_support/js_dsl.js in cucumber-0.7.3 vs lib/cucumber/js_support/js_dsl.js in cucumber-0.8.0
- old
+ new
@@ -18,14 +18,22 @@
afterHook: function(tag_expressions_or_func, func){
CucumberJsDsl.__registerJsHook('after', tag_expressions_or_func, func);
},
+ steps: function(step_names){
+ jsLanguage.steps(step_names);
+ },
+
Table: function(raw_table){
- this.raw = raw_table;
+ //TODO: Create a ruby table and send it back for use in js world
},
+ world: function(files){
+ jsLanguage.world(files);
+ },
+
__registerJsHook: function(label, tag_expressions_or_func, func){
if(func != null){
var hook_func = func;
var tag_expressions = tag_expressions_or_func;
} else {
@@ -34,36 +42,16 @@
}
jsLanguage.registerJsHook(label, tag_expressions, hook_func);
}
}
-CucumberJsDsl.Table.prototype.hashes = function(){
- var rows = this.rows();
- var headers = this.headers();
- var hashes = [];
-
- for (var rowIndex in rows){
- var hash_row = [];
- for (var cellIndex in headers){
- hash_row[headers[cellIndex]] = rows[rowIndex][cellIndex];
- }
- hashes[rowIndex] = hash_row;
- }
- return hashes;
-}
-
-CucumberJsDsl.Table.prototype.rows = function(){
- return this.raw.slice(1);
-}
-
-CucumberJsDsl.Table.prototype.headers = function(){
- var raw_cells = this.raw.slice(0);
- return raw_cells.shift();
-}
-
var Given = CucumberJsDsl.registerStepDefinition;
var When = CucumberJsDsl.registerStepDefinition;
var Then = CucumberJsDsl.registerStepDefinition;
var Before = CucumberJsDsl.beforeHook;
var After = CucumberJsDsl.afterHook;
-var Transform = CucumberJsDsl.registerTransform;
+var Transform = CucumberJsDsl.registerTransform;
+
+var World = CucumberJsDsl.world;
+
+var steps = CucumberJsDsl.steps;
\ No newline at end of file