{"action":"created","comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/comments/58050209","id":58050209,"diff_hunk":"@@ -0,0 +1,108 @@\n+var fs = require('fs');","path":"lib/chai-files.js","position":1,"original_position":1,"commit_id":"7a0f07e57d4979844c888e8beb92e0cbb3a713e3","original_commit_id":"7a0f07e57d4979844c888e8beb92e0cbb3a713e3","user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"body":"i would love access to this chai helper from other places, could I convince you this may want to live as its own module?","created_at":"2016-03-31T13:11:49Z","updated_at":"2016-03-31T13:11:49Z","html_url":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/45#discussion_r58050209","pull_request_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/comments/58050209"},"html":{"href":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/45#discussion_r58050209"},"pull_request":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45","id":64531818,"html_url":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/45","diff_url":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/45.diff","patch_url":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/45.patch","issue_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/issues/45","number":45,"state":"open","locked":false,"title":"[WIP] A new Promise-based testing API","user":{"login":"Turbo87","id":141300,"avatar_url":"https://avatars.githubusercontent.com/u/141300?v=3","gravatar_id":"","url":"https://api.github.com/users/Turbo87","html_url":"https://github.com/Turbo87","followers_url":"https://api.github.com/users/Turbo87/followers","following_url":"https://api.github.com/users/Turbo87/following{/other_user}","gists_url":"https://api.github.com/users/Turbo87/gists{/gist_id}","starred_url":"https://api.github.com/users/Turbo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turbo87/subscriptions","organizations_url":"https://api.github.com/users/Turbo87/orgs","repos_url":"https://api.github.com/users/Turbo87/repos","events_url":"https://api.github.com/users/Turbo87/events{/privacy}","received_events_url":"https://api.github.com/users/Turbo87/received_events","type":"User","site_admin":false},"body":"I'd like to propose a substantial API change for these helpers that should resolve #38, simplify the whole process of writing assertions and also greatly simplify our own code in this project.\r\n\r\nSome examples:\r\n\r\n```js\r\n  it('route foo', function() {\r\n    var args = ['route', 'foo'];\r\n\r\n    return emberNew()\r\n      .then(() => emberGenerate(args))\r\n      .then(() => expect(file('app/routes/foo.js'))\r\n        .to.contain('import Ember from \\'ember\\';')\r\n        .to.contain('export default Ember.Route.extend({\\n});'))\r\n\r\n      .then(() => expect(file('app/templates/foo.hbs'))\r\n        .to.contain('{{outlet}}'))\r\n\r\n      .then(() => expect(file('tests/unit/routes/foo-test.js'))\r\n        .to.contain('import { moduleFor, test } from \\'ember-qunit\\';')\r\n        .to.contain('moduleFor(\\'route:foo\\''))\r\n\r\n      .then(() => expect(file('app/router.js'))\r\n        .to.contain('this.route(\\'foo\\')'))\r\n\r\n      .then(() => emberDestroy(args))\r\n      .then(() => expect(file('app/routes/foo.js')).to.not.exist)\r\n      .then(() => expect(file('app/templates/foo.hbs')).to.not.exist)\r\n      .then(() => expect(file('tests/unit/routes/foo-test.js')).to.not.exist)\r\n      .then(() => expect(file('app/router.js'))\r\n        .to.not.contain('this.route(\\'foo\\')'));\r\n  });\r\n```\r\n\r\n```js\r\n  it('adapter throws when --base-class is same as name', function() {\r\n    var args = ['adapter', 'foo', '--base-class=foo'];\r\n\r\n    return emberNew()\r\n      .then(() => expect(emberGenerate(args))\r\n        .to.be.rejectedWith(SilentError, /Adapters cannot extend from themself/));\r\n  });\r\n```\r\n\r\nwith async/await:\r\n\r\n```js\r\n\r\n  it('route foo', async function() {\r\n    var args = ['route', 'foo'];\r\n\r\n    await emberNew();\r\n    await emberGenerate(args);\r\n\r\n    expect(file('app/routes/foo.js'))\r\n      .to.contain('import Ember from \\'ember\\';')\r\n      .to.contain('export default Ember.Route.extend({\\n});');\r\n\r\n    expect(file('app/templates/foo.hbs'))\r\n      .to.contain('{{outlet}}');\r\n\r\n    expect(file('tests/unit/routes/foo-test.js'))\r\n      .to.contain('import { moduleFor, test } from \\'ember-qunit\\';')\r\n      .to.contain('moduleFor(\\'route:foo\\'');\r\n\r\n    expect(file('app/router.js'))\r\n      .to.contain('this.route(\\'foo\\')');\r\n\r\n    await emberDestroy(args);\r\n\r\n    expect(file('app/routes/foo.js')).to.not.exist;\r\n    expect(file('app/templates/foo.hbs')).to.not.exist;\r\n    expect(file('tests/unit/routes/foo-test.js')).to.not.exist;\r\n    expect(file('app/router.js'))\r\n      .to.not.contain('this.route(\\'foo\\')');\r\n  });\r\n```\r\n\r\nI've experimented with this API already in the legacy blueprints project and you can find my converted code at https://github.com/Turbo87/ember-cli-legacy-blueprints/commits/bp-v2.\r\n\r\nWe can probably support both APIs for a certain amount of time to make the transition easier for everyone that's using the current API.\r\n\r\nNote that this is work-in-progress and not everything is polished yet, but the general concept seems to work very well.\r\n\r\n/cc @trabus @stefanpenner @rwjblue @kellyselden @nathanhammond ","created_at":"2016-03-29T20:50:54Z","updated_at":"2016-03-31T13:11:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65c0a69f11f57c96e26d7876d6cb91422511bb1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45/commits","review_comments_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45/comments","review_comment_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/issues/45/comments","statuses_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/statuses/7a0f07e57d4979844c888e8beb92e0cbb3a713e3","head":{"label":"Turbo87:v2","ref":"v2","sha":"7a0f07e57d4979844c888e8beb92e0cbb3a713e3","user":{"login":"Turbo87","id":141300,"avatar_url":"https://avatars.githubusercontent.com/u/141300?v=3","gravatar_id":"","url":"https://api.github.com/users/Turbo87","html_url":"https://github.com/Turbo87","followers_url":"https://api.github.com/users/Turbo87/followers","following_url":"https://api.github.com/users/Turbo87/following{/other_user}","gists_url":"https://api.github.com/users/Turbo87/gists{/gist_id}","starred_url":"https://api.github.com/users/Turbo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turbo87/subscriptions","organizations_url":"https://api.github.com/users/Turbo87/orgs","repos_url":"https://api.github.com/users/Turbo87/repos","events_url":"https://api.github.com/users/Turbo87/events{/privacy}","received_events_url":"https://api.github.com/users/Turbo87/received_events","type":"User","site_admin":false},"repo":{"id":52222747,"name":"ember-cli-blueprint-test-helpers","full_name":"Turbo87/ember-cli-blueprint-test-helpers","owner":{"login":"Turbo87","id":141300,"avatar_url":"https://avatars.githubusercontent.com/u/141300?v=3","gravatar_id":"","url":"https://api.github.com/users/Turbo87","html_url":"https://github.com/Turbo87","followers_url":"https://api.github.com/users/Turbo87/followers","following_url":"https://api.github.com/users/Turbo87/following{/other_user}","gists_url":"https://api.github.com/users/Turbo87/gists{/gist_id}","starred_url":"https://api.github.com/users/Turbo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turbo87/subscriptions","organizations_url":"https://api.github.com/users/Turbo87/orgs","repos_url":"https://api.github.com/users/Turbo87/repos","events_url":"https://api.github.com/users/Turbo87/events{/privacy}","received_events_url":"https://api.github.com/users/Turbo87/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Turbo87/ember-cli-blueprint-test-helpers","description":"Test helpers for testing ember-cli blueprints","fork":true,"url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers","forks_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/forks","keys_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/teams","hooks_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/hooks","issue_events_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/issues/events{/number}","events_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/events","assignees_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/assignees{/user}","branches_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/branches{/branch}","tags_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/tags","blobs_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/git/refs{/sha}","trees_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/statuses/{sha}","languages_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/languages","stargazers_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/stargazers","contributors_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/contributors","subscribers_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/subscribers","subscription_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/subscription","commits_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/commits{/sha}","git_commits_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/git/commits{/sha}","comments_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/comments{/number}","issue_comment_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/issues/comments{/number}","contents_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/contents/{+path}","compare_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/merges","archive_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/downloads","issues_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/issues{/number}","pulls_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/pulls{/number}","milestones_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/milestones{/number}","notifications_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/labels{/name}","releases_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/releases{/id}","deployments_url":"https://api.github.com/repos/Turbo87/ember-cli-blueprint-test-helpers/deployments","created_at":"2016-02-21T19:06:26Z","updated_at":"2016-02-21T19:06:27Z","pushed_at":"2016-03-31T09:26:55Z","git_url":"git://github.com/Turbo87/ember-cli-blueprint-test-helpers.git","ssh_url":"git@github.com:Turbo87/ember-cli-blueprint-test-helpers.git","clone_url":"https://github.com/Turbo87/ember-cli-blueprint-test-helpers.git","svn_url":"https://github.com/Turbo87/ember-cli-blueprint-test-helpers","homepage":null,"size":87,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ember-cli:master","ref":"master","sha":"f5b2fa0bd734f5c608bfe3f576992f52ef28b5dc","user":{"login":"ember-cli","id":10262982,"avatar_url":"https://avatars.githubusercontent.com/u/10262982?v=3","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"repo":{"id":43797618,"name":"ember-cli-blueprint-test-helpers","full_name":"ember-cli/ember-cli-blueprint-test-helpers","owner":{"login":"ember-cli","id":10262982,"avatar_url":"https://avatars.githubusercontent.com/u/10262982?v=3","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers","description":"Test helpers for testing ember-cli blueprints","fork":false,"url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers","forks_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/forks","keys_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/teams","hooks_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/hooks","issue_events_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/issues/events{/number}","events_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/events","assignees_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/assignees{/user}","branches_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/branches{/branch}","tags_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/tags","blobs_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/statuses/{sha}","languages_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/languages","stargazers_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/stargazers","contributors_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/contributors","subscribers_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/subscribers","subscription_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/subscription","commits_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/contents/{+path}","compare_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/merges","archive_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/downloads","issues_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/issues{/number}","pulls_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls{/number}","milestones_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/milestones{/number}","notifications_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/labels{/name}","releases_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/releases{/id}","deployments_url":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/deployments","created_at":"2015-10-07T05:52:12Z","updated_at":"2016-03-03T18:44:31Z","pushed_at":"2016-03-31T09:18:52Z","git_url":"git://github.com/ember-cli/ember-cli-blueprint-test-helpers.git","ssh_url":"git@github.com:ember-cli/ember-cli-blueprint-test-helpers.git","clone_url":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers.git","svn_url":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers","homepage":null,"size":84,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45"},"html":{"href":"https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/45"},"issue":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/issues/45"},"comments":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/ember-cli/ember-cli-blueprint-test-helpers/statuses/7a0f07e57d4979844c888e8beb92e0cbb3a713e3"}}}}