Skip to content
This repository has been archived by the owner on Nov 25, 2018. It is now read-only.

Commit

Permalink
Merge pull request #54 from eventualbuddha/no-initializer-names
Browse files Browse the repository at this point in the history
Stop including the name in initializer blueprints.
  • Loading branch information
Turbo87 authored Jun 22, 2017
2 parents 0970ce7 + 84267b6 commit aea1b9e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ export function initialize(/* application */) {
// application.inject('route', 'foo', 'service:foo');
}

export default {
name: '<%= dasherizedModuleName %>',
initialize
};
export default { initialize };
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ export function initialize(/* appInstance */) {
// appInstance.inject('route', 'foo', 'service:foo');
}

export default {
name: '<%= dasherizedModuleName %>',
initialize
};
export default { initialize };
60 changes: 12 additions & 48 deletions node-tests/blueprints/initializer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('tests/unit/initializers/foo-test.js'))
.to.contain("import { initialize } from 'my-app/initializers/foo';");
Expand All @@ -43,10 +40,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('tests/unit/initializers/foo/bar-test.js'))
.to.contain("import { initialize } from 'my-app/initializers/foo/bar';");
Expand All @@ -63,10 +57,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/initializers/foo.js'))
.to.contain("export { default, initialize } from 'my-addon/initializers/foo';");
Expand All @@ -86,10 +77,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/initializers/foo/bar.js'))
.to.contain("export { default, initialize } from 'my-addon/initializers/foo/bar';");
Expand All @@ -109,10 +97,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/initializers/foo.js'))
.to.not.exist;
Expand All @@ -132,10 +117,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/initializers/foo/bar.js'))
.to.not.exist;
Expand All @@ -155,10 +137,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('lib/my-addon/app/initializers/foo.js'))
.to.contain("export { default, initialize } from 'my-addon/initializers/foo';");
Expand All @@ -178,10 +157,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('lib/my-addon/app/initializers/foo/bar.js'))
.to.contain("export { default, initialize } from 'my-addon/initializers/foo/bar';");
Expand All @@ -203,10 +179,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand All @@ -221,10 +194,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand All @@ -238,10 +208,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand All @@ -257,10 +224,7 @@ describe('Acceptance: ember generate and destroy initializer', function() {
" // application.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand Down
60 changes: 12 additions & 48 deletions node-tests/blueprints/instance-initializer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('tests/unit/instance-initializers/foo-test.js'))
.to.contain("import { initialize } from 'my-app/instance-initializers/foo';");
Expand All @@ -43,10 +40,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('tests/unit/instance-initializers/foo/bar-test.js'))
.to.contain("import { initialize } from 'my-app/instance-initializers/foo/bar';");
Expand All @@ -63,10 +57,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/instance-initializers/foo.js'))
.to.contain("export { default, initialize } from 'my-addon/instance-initializers/foo';");
Expand All @@ -85,10 +76,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/instance-initializers/foo/bar.js'))
.to.contain("export { default, initialize } from 'my-addon/instance-initializers/foo/bar';");
Expand All @@ -107,10 +95,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/instance-initializers/foo.js'))
.to.not.exist;
Expand All @@ -130,10 +115,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('app/instance-initializers/foo/bar.js'))
.to.not.exist;
Expand All @@ -153,10 +135,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('lib/my-addon/app/instance-initializers/foo.js'))
.to.contain("export { default, initialize } from 'my-addon/instance-initializers/foo';");
Expand All @@ -175,10 +154,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");

expect(_file('lib/my-addon/app/instance-initializers/foo/bar.js'))
.to.contain("export { default, initialize } from 'my-addon/instance-initializers/foo/bar';");
Expand All @@ -197,10 +173,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand All @@ -215,10 +188,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand All @@ -232,10 +202,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand All @@ -251,10 +218,7 @@ describe('Acceptance: ember generate and destroy instance-initializer', function
" // appInstance.inject('route', 'foo', 'service:foo');\n" +
"}\n" +
"\n" +
"export default {\n" +
" name: 'foo/bar',\n" +
" initialize\n" +
"};");
"export default { initialize };");
}));
});

Expand Down

0 comments on commit aea1b9e

Please sign in to comment.