Работая над Windows, я установил Ruby и Ruby DevKit, чтобы получить работу с Cucumber. Теперь у меня есть следующие основные настройки:Почему Огурец не выполняет определения моего шага?
/app
/features
example.feature
/step_definitions
example.steps.js
В файле example.feature у меня есть:
Feature: This is an example feature
In order to learn Cucumber
As a developer
I want to make this feature pass
Scenario: wrote my first scenario
Given a variable set to 1
When I increment the variable by 2
Then the variable should contain 3
И в example.step.js файл у меня есть:
'use strict';
module.exports = function() {
this.givenNumber = 0;
this.Given(/^a variable set to (\d+)$/, function(number, next) {
this.givenNumber = parseInt(number);
next();
});
this.When(/^I increment the variable by (\d+)$/, function (number, next) {
this.givenNumber = this.givenNumber + parseInt(number);
next();
});
this.Then(/^the variable should contain (\d+)$/, function (number, next) {
if (this.givenNumber != number)
throw(new Error("This test didn't pass, givenNumber is " + this.givenNumber + " expected 0"));
next();
});
};
Теперь, когда я запускаю «огурец» из каталога/app, я продолжаю получать следующий вывод:
1 scenario (1 undefined)
3 steps (3 undefined)
0m0.004s
Я попытался перемещаться по файлам, добавив параметр --require и т. Д., Но ничего не помогает.
Любые идеи?