Skip to content

Commit

Permalink
grasduinen
Browse files Browse the repository at this point in the history
  • Loading branch information
remkoboschker committed Aug 20, 2015
1 parent a7e8c89 commit 3f6e472
Show file tree
Hide file tree
Showing 18 changed files with 260 additions and 5 deletions.
6 changes: 6 additions & 0 deletions blueprints/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"predef": [
"console"
],
"strict": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feature: <%= featureName %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Yadda from 'yadda';
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';




Yadda.plugins.mocha.StepLevelPlugin.init();

new Yadda.FeatureFileSearch('./').each(function(file) {

featureFile(file, function(feature) {
let stepFileName = `../steps/${feature.title}-step.js`
import * as library from stepFileName;
let yadda = Yadda.createInstance(library);

module(`Feature: ${feature.title}`, {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

scenarios(feature.scenarios, function(scenario) {
test(`Scenario: ${scenario.title}`, yadda.run(scenario));
});
});
});
20 changes: 20 additions & 0 deletions blueprints/ember-cli-yadda/files/tests/steps/__name__-step.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';
import { localisation } from 'yadda';

let Nederlands = localisation.Nederlands;

module('make feature', {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

test('Scenario generate', function(assert) {
Nederlands.
});
14 changes: 14 additions & 0 deletions blueprints/ember-cli-yadda/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
description: ''

// locals: function(options) {
// // Return custom template variables here.
// return {
// foo: options.entity.options.foo
// };
// }

// afterInstall: function(options) {
// // Perform extra work here.
// }
};
21 changes: 21 additions & 0 deletions blueprints/feature/files/tests/acceptance/__name__-steps-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';

module('<%= featureName %>', {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

test('visiting /<%= dasherizedModuleName %>', function(assert) {
visit('/<%= dasherizedModuleName %>');

andThen(function() {
assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
});
});
1 change: 1 addition & 0 deletions blueprints/feature/files/tests/acceptance/__name__.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feature: <%= featureName %>
21 changes: 21 additions & 0 deletions blueprints/feature/files/tests/acceptance/acceptance-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';

module('<%= featureName %>', {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

test('visiting /<%= dasherizedModuleName %>', function(assert) {
visit('/<%= dasherizedModuleName %>');

andThen(function() {
assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
});
});
20 changes: 20 additions & 0 deletions blueprints/feature/files/tests/acceptance/steps/__name__-step.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';
import { localisation } from 'yadda';

let Nederlands = localisation.Nederlands;

module('make feature', {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

test('Scenario generate', function(assert) {
Nederlands.
});
20 changes: 20 additions & 0 deletions blueprints/feature/files/tests/steps/__name__-step.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';
import { localisation } from 'yadda';

let Nederlands = localisation.Nederlands;

module('make feature', {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

test('Scenario generate', function(assert) {
Nederlands.
});
19 changes: 19 additions & 0 deletions blueprints/feature/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
description: '',
locals: function(options) {
return {
featureName: options.entity.name.replace(/-/g, ' ')
};
}

// locals: function(options) {
// // Return custom template variables here.
// return {
// foo: options.entity.options.foo
// };
// }

// afterInstall: function(options) {
// // Perform extra work here.
// }
};
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@
'use strict';

module.exports = {
name: 'ember-cli-yadda'
name: 'ember-cli-yadda',
included: function(app) {
this.__super.included(app);
app.import('yadda');
},
includedCommands: function () {

}
};
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,26 @@
"ember-cli-sri": "^1.0.3",
"ember-cli-uglify": "^1.2.0",
"ember-data": "1.13.8",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-try": "0.0.6"
},
"keywords": [
"ember-addon"
"ember-addon",
"yadda",
"bdd",
"acceptance testing",
"gherkin",
"cucumber",
"specifications",
"features"
],
"dependencies": {
"ember-cli-babel": "^5.1.3"
"ember-cli-babel": "^5.1.3",
"yadda": "^0.15.2"
},
"ember-addon": {
"configPath": "tests/dummy/config"
}
}
}
7 changes: 7 additions & 0 deletions specs/make-feature.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: make feature

Scenario: generate

Given I type "Ember g feature make feature"
When I look in the folder
Then I should find a file
1 change: 1 addition & 0 deletions tests/acceptance/barrys.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feature: barrys
17 changes: 17 additions & 0 deletions tests/acceptance/make-feature-steps-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';
import { localisation } from 'yadda';

const Nederlands = localisation.English;

export default English.library()
.given('I type "Ember g feature make feature"', function(next) {
next();
})
.when('I look in the folder', function(next) {
next();
})
.then('I should find a file', function(next) {
next();
})
20 changes: 20 additions & 0 deletions tests/acceptance/steps/barrys-step.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';
import { localisation } from 'yadda';

let Nederlands = localisation.Nederlands;

module('make feature', {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

test('Scenario generate', function(assert) {
Nederlands.
});
20 changes: 20 additions & 0 deletions tests/steps/barrys-step.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '/tests/helpers/start-app';
import { localisation } from 'yadda';

let Nederlands = localisation.Nederlands;

module('make feature', {
beforeEach: function() {
this.application = startApp();
},

afterEach: function() {
Ember.run(this.application, 'destroy');
}
});

test('Scenario generate', function(assert) {
Nederlands.
});

0 comments on commit 3f6e472

Please sign in to comment.