Permalink
Browse files

Organize methods

  • Loading branch information...
1 parent fc662ed commit df69e13ddc921bd1e58f710b40481e5aaee9c4d3 @jbpros jbpros committed Dec 25, 2012
Showing with 13 additions and 14 deletions.
  1. +9 −10 lib/cucumber/ast/background.js
  2. +4 −4 lib/cucumber/ast/scenario.js
@@ -4,7 +4,6 @@ var Background = function(keyword, name, description, uri, line) {
var steps = Cucumber.Type.Collection();
var self = {
-
getKeyword: function getKeyword() {
return keyword;
},
@@ -31,22 +30,22 @@ var Background = function(keyword, name, description, uri, line) {
steps.add(step);
},
+ getLastStep: function getLastStep() {
+ return steps.getLast();
+ },
+
+ getSteps: function getSteps() {
+ return steps;
+ },
+
getMaxStepLength: function () {
var max = 0;
steps.syncForEach(function(step) {
var output = step.getKeyword() + step.getName();
if (output.length > max) max = output.length;
});
return max;
- },
-
- getLastStep: function getLastStep() {
- return steps.getLast();
- },
-
- getSteps: function getSteps() {
- return steps;
- }
+ }
};
return self;
};
@@ -41,6 +41,10 @@ var Scenario = function(keyword, name, description, uri, line) {
steps.add(step);
},
+ getLastStep: function getLastStep() {
+ return steps.getLast();
+ },
+
getMaxStepLength: function () {
var max = 0;
steps.syncForEach(function(step) {
@@ -50,10 +54,6 @@ var Scenario = function(keyword, name, description, uri, line) {
return max;
},
- getLastStep: function getLastStep() {
- return steps.getLast();
- },
-
addTags: function addTags(newTags) {
tags = tags.concat(newTags);
},

0 comments on commit df69e13

Please sign in to comment.