cucumber
Version:
The official JavaScript implementation of Cucumber.
45 lines (34 loc) • 838 B
JavaScript
function Background(keyword, name, description, uri, line) {
var Cucumber = require('../../cucumber');
var steps = Cucumber.Type.Collection();
var self = {
getKeyword: function getKeyword() {
return keyword;
},
getName: function getName() {
return name;
},
getDescription: function getDescription() {
return description;
},
getUri: function getUri() {
return uri;
},
getLine: function getLine() {
return line;
},
addStep: function addStep(step) {
var lastStep = self.getLastStep();
step.setPreviousStep(lastStep);
steps.add(step);
},
getLastStep: function getLastStep() {
return steps.getLast();
},
getSteps: function getSteps() {
return steps;
}
};
return self;
}
module.exports = Background;