{"action":"created","comment":{"url":"https://api.github.com/repos/enb-make/enb/pulls/comments/36080620","id":36080620,"diff_hunk":"@@ -0,0 +1,557 @@\n+var sinon = require('sinon');\n+var sinonChai = require('sinon-chai');\n+var chai = require('chai');\n+var expect = chai.expect;\n+var path = require('path');\n+var NodeConfig = require('../../../lib/config/node-config');\n+var ModeConfig = require('../../../lib/config/mode-config');\n+var BaseTech = require('../../../lib/tech/base-tech');\n+var FileAssembleTech = require('../../../lib/tech/file-assemble-tech');\n+var ChunksTech = require('../../../lib/tech/chunks');\n+\n+chai.use(sinonChai);\n+\n+describe('config/node-config', function () {\n+    describe('constructor', function () {\n+        it('should call parent constructor', function () {\n+            var nodeConfig = new NodeConfig();\n+\n+            expect(nodeConfig._chains).to.be.instanceOf(Array)\n+                .and.to.be.empty;\n+        });\n+\n+        it('should set path to node', function () {\n+            var nodePath = 'test/node/path';\n+            var nodeConfig = new NodeConfig(nodePath);\n+\n+            expect(nodeConfig.getPath()).to.be.equal(nodePath);\n+        });\n+\n+        it('should set project root path', function () {\n+            var rootPath = 'test/root/path';\n+            var nodeConfig = new NodeConfig(null, rootPath);\n+\n+            expect(nodeConfig._root).to.be.equal(rootPath);\n+        });\n+\n+        it('should set project config', function () {\n+            var projectConfig = {};\n+            var nodeConfig = new NodeConfig(null, null, projectConfig);\n+\n+            expect(nodeConfig._projectConfig).to.be.equal(projectConfig);\n+        });\n+\n+        it('should set basename of node path', function () {\n+            var nodePath = 'test/node/path/node.js';\n+            var expectedBaseName = 'node.js';\n+            var nodeConfig = new NodeConfig(nodePath);\n+\n+            expect(nodeConfig._baseName).to.be.equal(expectedBaseName);\n+        });\n+\n+        it('should create container for targets', function () {\n+            var nodeConfig = new NodeConfig();\n+\n+            expect(nodeConfig._targets).to.be.instanceOf(Array)\n+                .and.to.be.empty;\n+        });\n+\n+        it('should create container for targets which must be removed on \\'make clean\\' run', function () {\n+            var nodeConfig = new NodeConfig();\n+\n+            expect(nodeConfig._cleanTargets).to.be.instanceOf(Array)\n+                .and.to.be.empty;\n+        });\n+\n+        it('shoud create container for techs', function () {\n+            var nodeConfig = new NodeConfig();\n+\n+            expect(nodeConfig._techs).to.be.instanceOf(Array)\n+                .and.to.be.empty;\n+        });\n+\n+        it('should create containter for modes', function () {\n+            var nodeConfig = new NodeConfig();\n+\n+            expect(nodeConfig._modes).to.be.instanceOf(Object)\n+                .and.to.be.empty;\n+        });\n+    });\n+\n+    describe('mode', function () {\n+        var nodeConfig;\n+        var testMode = 'test_mode';\n+\n+        beforeEach(function () {\n+            nodeConfig = new NodeConfig();\n+        });\n+\n+        it('should create mode config for a mode', function () {\n+            nodeConfig.mode(testMode);\n+\n+            expect(nodeConfig.getModeConfig(testMode)).to.be.instanceOf(ModeConfig);\n+        });\n+\n+        it('should not overwrite mode config if it was already created', function () {\n+            var initialModeConfig;\n+\n+            nodeConfig.mode(testMode);\n+            initialModeConfig = nodeConfig.getModeConfig(testMode);\n+            nodeConfig.mode(testMode);\n+\n+            expect(nodeConfig.getModeConfig(testMode)).to.be.equal(initialModeConfig);\n+        });\n+\n+        it('should add task to mode config of required mode', function () {\n+            var task = function () {};\n+\n+            nodeConfig.mode(testMode, task);\n+\n+            expect(nodeConfig.getModeConfig(testMode)._chains).to.contain(task);\n+        });\n+\n+        it('should support method chaining pattern', function () {\n+            var result = nodeConfig.mode(testMode);\n+\n+            expect(result).to.be.equal(nodeConfig);\n+        });\n+    });\n+\n+    describe('setLanguages', function () {\n+        var nodeConfig;\n+        var languages = ['ru'];\n+\n+        beforeEach(function () {\n+            nodeConfig = new NodeConfig();\n+        });\n+\n+        it('should set languages for node', function () {\n+            nodeConfig.setLanguages(languages);\n+\n+            expect(nodeConfig.getLanguages()).to.be.equal(languages);\n+        });\n+\n+        it('should support method chaining pattern', function () {\n+            expect(nodeConfig.setLanguages(languages)).to.be.equal(nodeConfig);\n+        });\n+    });\n+\n+    describe('getNodePath', function () {\n+        it('should return absolute path to the node', function () {\n+            var rootPath = 'root/path';\n+            var nodePath = 'node/path';\n+            var nodeConfig = new NodeConfig(nodePath, rootPath);\n+\n+            expect(nodeConfig.getNodePath()).to.be.equal(rootPath + '/' + nodePath);","path":"test/lib/config/node-config.js","position":145,"original_position":145,"commit_id":"c63691e81600fb2c83e0c589a509107f0ea703c1","original_commit_id":"c63691e81600fb2c83e0c589a509107f0ea703c1","user":{"login":"SwinX","id":854899,"avatar_url":"https://avatars.githubusercontent.com/u/854899?v=3","gravatar_id":"","url":"https://api.github.com/users/SwinX","html_url":"https://github.com/SwinX","followers_url":"https://api.github.com/users/SwinX/followers","following_url":"https://api.github.com/users/SwinX/following{/other_user}","gists_url":"https://api.github.com/users/SwinX/gists{/gist_id}","starred_url":"https://api.github.com/users/SwinX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwinX/subscriptions","organizations_url":"https://api.github.com/users/SwinX/orgs","repos_url":"https://api.github.com/users/SwinX/repos","events_url":"https://api.github.com/users/SwinX/events{/privacy}","received_events_url":"https://api.github.com/users/SwinX/received_events","type":"User","site_admin":false},"body":"Он так в реализации getNodePath строится. Надо запомнить и прислать PR.","created_at":"2015-08-03T12:36:52Z","updated_at":"2015-08-03T12:36:52Z","html_url":"https://github.com/enb-make/enb/pull/298#discussion_r36080620","pull_request_url":"https://api.github.com/repos/enb-make/enb/pulls/298","_links":{"self":{"href":"https://api.github.com/repos/enb-make/enb/pulls/comments/36080620"},"html":{"href":"https://github.com/enb-make/enb/pull/298#discussion_r36080620"},"pull_request":{"href":"https://api.github.com/repos/enb-make/enb/pulls/298"}}},"pull_request":{"url":"https://api.github.com/repos/enb-make/enb/pulls/298","id":41325144,"html_url":"https://github.com/enb-make/enb/pull/298","diff_url":"https://github.com/enb-make/enb/pull/298.diff","patch_url":"https://github.com/enb-make/enb/pull/298.patch","issue_url":"https://api.github.com/repos/enb-make/enb/issues/298","number":298,"state":"open","locked":false,"title":"Tests for Config/NodeConfig","user":{"login":"SwinX","id":854899,"avatar_url":"https://avatars.githubusercontent.com/u/854899?v=3","gravatar_id":"","url":"https://api.github.com/users/SwinX","html_url":"https://github.com/SwinX","followers_url":"https://api.github.com/users/SwinX/followers","following_url":"https://api.github.com/users/SwinX/following{/other_user}","gists_url":"https://api.github.com/users/SwinX/gists{/gist_id}","starred_url":"https://api.github.com/users/SwinX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwinX/subscriptions","organizations_url":"https://api.github.com/users/SwinX/orgs","repos_url":"https://api.github.com/users/SwinX/repos","events_url":"https://api.github.com/users/SwinX/events{/privacy}","received_events_url":"https://api.github.com/users/SwinX/received_events","type":"User","site_admin":false},"body":"resolves #284 ","created_at":"2015-07-31T10:07:28Z","updated_at":"2015-08-03T12:36:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5fcc839c7b048901ea394da88770cd68811540e","assignee":{"login":"SwinX","id":854899,"avatar_url":"https://avatars.githubusercontent.com/u/854899?v=3","gravatar_id":"","url":"https://api.github.com/users/SwinX","html_url":"https://github.com/SwinX","followers_url":"https://api.github.com/users/SwinX/followers","following_url":"https://api.github.com/users/SwinX/following{/other_user}","gists_url":"https://api.github.com/users/SwinX/gists{/gist_id}","starred_url":"https://api.github.com/users/SwinX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwinX/subscriptions","organizations_url":"https://api.github.com/users/SwinX/orgs","repos_url":"https://api.github.com/users/SwinX/repos","events_url":"https://api.github.com/users/SwinX/events{/privacy}","received_events_url":"https://api.github.com/users/SwinX/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/enb-make/enb/pulls/298/commits","review_comments_url":"https://api.github.com/repos/enb-make/enb/pulls/298/comments","review_comment_url":"https://api.github.com/repos/enb-make/enb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enb-make/enb/issues/298/comments","statuses_url":"https://api.github.com/repos/enb-make/enb/statuses/c63691e81600fb2c83e0c589a509107f0ea703c1","head":{"label":"enb-make:issue-284","ref":"issue-284","sha":"c63691e81600fb2c83e0c589a509107f0ea703c1","user":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"repo":{"id":10054361,"name":"enb","full_name":"enb-make/enb","owner":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enb-make/enb","description":"Faster BEM/BEViS assembler","fork":false,"url":"https://api.github.com/repos/enb-make/enb","forks_url":"https://api.github.com/repos/enb-make/enb/forks","keys_url":"https://api.github.com/repos/enb-make/enb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enb-make/enb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enb-make/enb/teams","hooks_url":"https://api.github.com/repos/enb-make/enb/hooks","issue_events_url":"https://api.github.com/repos/enb-make/enb/issues/events{/number}","events_url":"https://api.github.com/repos/enb-make/enb/events","assignees_url":"https://api.github.com/repos/enb-make/enb/assignees{/user}","branches_url":"https://api.github.com/repos/enb-make/enb/branches{/branch}","tags_url":"https://api.github.com/repos/enb-make/enb/tags","blobs_url":"https://api.github.com/repos/enb-make/enb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enb-make/enb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enb-make/enb/git/refs{/sha}","trees_url":"https://api.github.com/repos/enb-make/enb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enb-make/enb/statuses/{sha}","languages_url":"https://api.github.com/repos/enb-make/enb/languages","stargazers_url":"https://api.github.com/repos/enb-make/enb/stargazers","contributors_url":"https://api.github.com/repos/enb-make/enb/contributors","subscribers_url":"https://api.github.com/repos/enb-make/enb/subscribers","subscription_url":"https://api.github.com/repos/enb-make/enb/subscription","commits_url":"https://api.github.com/repos/enb-make/enb/commits{/sha}","git_commits_url":"https://api.github.com/repos/enb-make/enb/git/commits{/sha}","comments_url":"https://api.github.com/repos/enb-make/enb/comments{/number}","issue_comment_url":"https://api.github.com/repos/enb-make/enb/issues/comments{/number}","contents_url":"https://api.github.com/repos/enb-make/enb/contents/{+path}","compare_url":"https://api.github.com/repos/enb-make/enb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enb-make/enb/merges","archive_url":"https://api.github.com/repos/enb-make/enb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enb-make/enb/downloads","issues_url":"https://api.github.com/repos/enb-make/enb/issues{/number}","pulls_url":"https://api.github.com/repos/enb-make/enb/pulls{/number}","milestones_url":"https://api.github.com/repos/enb-make/enb/milestones{/number}","notifications_url":"https://api.github.com/repos/enb-make/enb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enb-make/enb/labels{/name}","releases_url":"https://api.github.com/repos/enb-make/enb/releases{/id}","created_at":"2013-05-14T12:15:32Z","updated_at":"2015-08-01T18:56:54Z","pushed_at":"2015-08-02T18:57:20Z","git_url":"git://github.com/enb-make/enb.git","ssh_url":"git@github.com:enb-make/enb.git","clone_url":"https://github.com/enb-make/enb.git","svn_url":"https://github.com/enb-make/enb","homepage":"http://enb-make.info","size":3619,"stargazers_count":98,"watchers_count":98,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":49,"forks":45,"open_issues":49,"watchers":98,"default_branch":"master"}},"base":{"label":"enb-make:master","ref":"master","sha":"4f3acad17b4ca5b85b4d4e0e86314177f8947fb4","user":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"repo":{"id":10054361,"name":"enb","full_name":"enb-make/enb","owner":{"login":"enb-make","id":4427117,"avatar_url":"https://avatars.githubusercontent.com/u/4427117?v=3","gravatar_id":"","url":"https://api.github.com/users/enb-make","html_url":"https://github.com/enb-make","followers_url":"https://api.github.com/users/enb-make/followers","following_url":"https://api.github.com/users/enb-make/following{/other_user}","gists_url":"https://api.github.com/users/enb-make/gists{/gist_id}","starred_url":"https://api.github.com/users/enb-make/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enb-make/subscriptions","organizations_url":"https://api.github.com/users/enb-make/orgs","repos_url":"https://api.github.com/users/enb-make/repos","events_url":"https://api.github.com/users/enb-make/events{/privacy}","received_events_url":"https://api.github.com/users/enb-make/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enb-make/enb","description":"Faster BEM/BEViS assembler","fork":false,"url":"https://api.github.com/repos/enb-make/enb","forks_url":"https://api.github.com/repos/enb-make/enb/forks","keys_url":"https://api.github.com/repos/enb-make/enb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enb-make/enb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enb-make/enb/teams","hooks_url":"https://api.github.com/repos/enb-make/enb/hooks","issue_events_url":"https://api.github.com/repos/enb-make/enb/issues/events{/number}","events_url":"https://api.github.com/repos/enb-make/enb/events","assignees_url":"https://api.github.com/repos/enb-make/enb/assignees{/user}","branches_url":"https://api.github.com/repos/enb-make/enb/branches{/branch}","tags_url":"https://api.github.com/repos/enb-make/enb/tags","blobs_url":"https://api.github.com/repos/enb-make/enb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enb-make/enb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enb-make/enb/git/refs{/sha}","trees_url":"https://api.github.com/repos/enb-make/enb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enb-make/enb/statuses/{sha}","languages_url":"https://api.github.com/repos/enb-make/enb/languages","stargazers_url":"https://api.github.com/repos/enb-make/enb/stargazers","contributors_url":"https://api.github.com/repos/enb-make/enb/contributors","subscribers_url":"https://api.github.com/repos/enb-make/enb/subscribers","subscription_url":"https://api.github.com/repos/enb-make/enb/subscription","commits_url":"https://api.github.com/repos/enb-make/enb/commits{/sha}","git_commits_url":"https://api.github.com/repos/enb-make/enb/git/commits{/sha}","comments_url":"https://api.github.com/repos/enb-make/enb/comments{/number}","issue_comment_url":"https://api.github.com/repos/enb-make/enb/issues/comments{/number}","contents_url":"https://api.github.com/repos/enb-make/enb/contents/{+path}","compare_url":"https://api.github.com/repos/enb-make/enb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enb-make/enb/merges","archive_url":"https://api.github.com/repos/enb-make/enb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enb-make/enb/downloads","issues_url":"https://api.github.com/repos/enb-make/enb/issues{/number}","pulls_url":"https://api.github.com/repos/enb-make/enb/pulls{/number}","milestones_url":"https://api.github.com/repos/enb-make/enb/milestones{/number}","notifications_url":"https://api.github.com/repos/enb-make/enb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enb-make/enb/labels{/name}","releases_url":"https://api.github.com/repos/enb-make/enb/releases{/id}","created_at":"2013-05-14T12:15:32Z","updated_at":"2015-08-01T18:56:54Z","pushed_at":"2015-08-02T18:57:20Z","git_url":"git://github.com/enb-make/enb.git","ssh_url":"git@github.com:enb-make/enb.git","clone_url":"https://github.com/enb-make/enb.git","svn_url":"https://github.com/enb-make/enb","homepage":"http://enb-make.info","size":3619,"stargazers_count":98,"watchers_count":98,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":49,"forks":45,"open_issues":49,"watchers":98,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enb-make/enb/pulls/298"},"html":{"href":"https://github.com/enb-make/enb/pull/298"},"issue":{"href":"https://api.github.com/repos/enb-make/enb/issues/298"},"comments":{"href":"https://api.github.com/repos/enb-make/enb/issues/298/comments"},"review_comments":{"href":"https://api.github.com/repos/enb-make/enb/pulls/298/comments"},"review_comment":{"href":"https://api.github.com/repos/enb-make/enb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enb-make/enb/pulls/298/commits"},"statuses":{"href":"https://api.github.com/repos/enb-make/enb/statuses/c63691e81600fb2c83e0c589a509107f0ea703c1"}}}}