Skip to content

Commit

Permalink
cleaning up travis to remove trying to install bundler, actually impl…
Browse files Browse the repository at this point in the history
…emented scenario outline steps, implemented snipper builder steps for example outline snippets
  • Loading branch information
vantreeseba committed Feb 11, 2014
1 parent 60b437c commit d8efad6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,6 @@ before_install:
- ruby --version
- gem --version
- rvm --version
- rvm @global do gem install bundler
- bundle install

script: "rake"
Expand Down
8 changes: 8 additions & 0 deletions features/step_definition_snippets.feature
Expand Up @@ -25,3 +25,11 @@ Feature: step definition snippets
"""
When Cucumber executes the scenario
Then a "Given" step definition snippet for /^I have some "([^"]*)", "([^"]*)" and "([^"]*)" cucumbers$/ with 3 parameters is suggested
Scenario: outline steps with examples
Given a scenario with:
"""
Given I have <some> cucumbers
"""
When Cucumber executes the scenario
Then a "Given" example step definition snippet for /^I have "(.*)" cucumbers$/ with 1 parameters is suggested
13 changes: 8 additions & 5 deletions features/step_definitions/scenario_outline_steps.js
Expand Up @@ -3,13 +3,16 @@ var scenario_outline_steps = function() {
var World = require('./cucumber_world').World;
this.World = World;

this.When(/^a ([^"]*) step$/, function (some, callback) {
callback();
this.When(/^a (.*) step$/, function (some, callback) {
this.assertTrue(some === "passing" || some === "failing");
callback();
});

this.Then(/^i get ([^"]*)$/, function (result, callback) {
callback();
});
this.Then(/^i get (.*)$/, function (result, callback) {
this.assertTrue(result === "passed" || result === "skipped");
callback();
});

}

module.exports = scenario_outline_steps;
@@ -1,46 +1,38 @@
var missing_steps = function() {
var Given = When = Then = this.defineStep;
var World = require('./cucumber_world').World;
this.World = World;
var stepDefinitionSnippetsSteps = function() {
var Given = When = Then = this.defineStep;
var World = require('./cucumber_world').World;
this.World = World;

this.Given(/^the step "([^"]*)" has a mapping asynchronously failing through an exception with the message "([^"]*)"$/, function (arg1, arg2, callback) {
// express the regexp above with the code you wish you had
callback.pending();
});

this.Then(/^it should pass with:$/, function (string, callback) {
this.Then(/^a "([^"]*)" step definition snippet for \/\^I am a happy veggie \\\\o\\\/\$\/ is suggested$/, function (arg1, callback) {
// express the regexp above with the code you wish you had
callback.pending();
});

this.Given(/^a mapping written in CoffeeScript$/, function (callback) {
this.Then(/^a "([^"]*)" step definition snippet for \/\^I type \\\-\\\[\\\]\\\{\\\}\\\(\\\)\\\*\\\+\\\?\\\.\\\\\\\^\\\$\\\|\\\#\\\/\$\/ is suggested$/, function (arg1, callback) {
// express the regexp above with the code you wish you had
callback.pending();
});

this.Given(/^a mapping written in PogoScript$/, function (callback) {
this.Then(/^a "([^"]*)" step definition snippet for \/\^I have \(\\d\+\) "([^"]*)"\]\*\)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, callback) {
// express the regexp above with the code you wish you had
callback.pending();
});

this.Then(/^a "([^"]*)" step definition snippet for \/\^I am a happy veggie \\\\o\\\/\$\/ is suggested$/, function (arg1, callback) {
this.Then(/^a "([^"]*)" step definition snippet for \/\^I have some "([^"]*)"\]\*\)"([^"]*)"\(\[\^"([^"]*)" and "([^"]*)"\]\*\)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, arg4, arg5, arg6, callback) {
// express the regexp above with the code you wish you had
callback.pending();
});

this.Then(/^a "([^"]*)" step definition snippet for \/\^I type \\\-\\\[\\\]\\\{\\\}\\\(\\\)\\\*\\\+\\\?\\\.\\\\\\\^\\\$\\\|\\\#\\\/\$\/ is suggested$/, function (arg1, callback) {
// express the regexp above with the code you wish you had
this.Then(/^a "([^"]*)" step definition snippet for \/\^I have "([^"]*)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, callback) {
callback.pending();
});

this.Then(/^a "([^"]*)" step definition snippet for \/\^I have \(\\d\+\) "([^"]*)"\]\*\)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, callback) {
// express the regexp above with the code you wish you had
callback.pending();
this.Then(/^a "([^"]*)" example step definition snippet for \/\^I have "([^"]*)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, callback) {
this.assertEqual(arg1, "Given");
this.assertEqual(arg2,'(.*)');
this.assertEqual(arg3,"1");
callback();
});
}

this.Then(/^a "([^"]*)" step definition snippet for \/\^I have some "([^"]*)"\]\*\)"([^"]*)"\(\[\^"([^"]*)" and "([^"]*)"\]\*\)" cucumbers\$\/ with (\d+) parameters is suggested$/, function (arg1, arg2, arg3, arg4, arg5, arg6, callback) {
// express the regexp above with the code you wish you had
callback.pending();
});
};
module.exports = missing_steps;
module.exports = stepDefinitionSnippetsSteps;
Expand Up @@ -45,7 +45,7 @@ Syntax.prototype = {
},

getOutlineExampleMatchingGroup: function() {
return '([^"]*)';
return '(.*)';
},

getFunctionParameterSeparator: function() {
Expand Down

0 comments on commit d8efad6

Please sign in to comment.