{"action":"created","comment":{"url":"https://api.github.com/repos/enb-make/enb-borschik/pulls/comments/33265310","id":33265310,"diff_hunk":"@@ -0,0 +1,298 @@\n+var EOL = require('os').EOL,\n+    fs = require('fs'),\n+    path = require('path'),\n+    fsExtra = require('fs-extra'),\n+    clearConfigCache = require('borschik/lib/freeze').clearConfigCache,\n+    MockNode = require('mock-enb/lib/mock-node'),\n+    Tech = require('../../techs/borschik');\n+\n+describe('borschik', function () {\n+    var TEST_DATA_FOLDER = path.resolve('./bundle');\n+\n+    beforeEach(function () {\n+        fsExtra.ensureDirSync(TEST_DATA_FOLDER);\n+    });\n+\n+    afterEach(function () {\n+        clearConfigCache();\n+        fsExtra.deleteSync(TEST_DATA_FOLDER);\n+    });\n+\n+    describe('required options', function () {\n+        it('must throw error if sourceTarget property is missed', function () {\n+            var options = {},\n+                bundle = new MockNode('bundle');\n+\n+            (function () {\n+                return bundle.runTechAndGetContent(Tech, options);\n+            }).must.throw('Option \"source\" is required for technology \"borschik\".');\n+        });\n+\n+        it('must throw error if destTarget property is missed', function () {\n+            var options = { sourceTarget: '?.css' },\n+                bundle = new MockNode('bundle');\n+\n+            (function () {\n+                return bundle.runTechAndGetContent(Tech, options);\n+            }).must.throw('Option \"target\" is required for technology \"borschik\".');\n+        });\n+    });\n+\n+    describe('css', function () {\n+        var baseOptions = {\n+            sourceTarget: '?.css',\n+            destTarget: '_?.css',\n+            noCache: true\n+        };\n+\n+        it('must replace links in css file', function () {\n+            var scheme = {\n+                    configFile: { paths: { './': '/borschik/' } },\n+                    'bundle.css': '.block { background-image: url(./a/b.gif); }'\n+                },\n+                options = mergeConfigs(baseOptions, {\n+                    minify: false,\n+                    freeze: false\n+                });\n+\n+            return build(scheme, options).then(function (content) {\n+                content.must.equal('.block { background-image: url(\"/borschik/a/b.gif\"); }');\n+            });\n+        });\n+\n+        it('must replace links in css file with minify option', function () {\n+            var scheme = {\n+                    configFile: { paths: { './': '/borschik/' } },\n+                    'bundle.css': '.block { background-image: url(./a/b.gif); }'\n+                },\n+                options = mergeConfigs(baseOptions, {\n+                    minify: true,\n+                    freeze: false\n+                });\n+\n+            return build(scheme, options).then(function (content) {\n+                content.must.equal('.block{background-image:url(\"/borschik/a/b.gif\")}');\n+            });\n+        });\n+\n+\n+        it('must replace links in css file with freeze option', function () {\n+            var scheme = {\n+                    configFile: {\n+                        freeze_paths: {\n+                            '**/*': 'freeze'\n+                        }\n+                    },\n+                    'image.gif': new Buffer('Hello World'),\n+                    'bundle.css': '.block { background-image: url(\"image.gif\"); }'\n+                },\n+                options = mergeConfigs(baseOptions, {\n+                    minify: false,\n+                    freeze: true\n+                });\n+\n+            return build(scheme, options).then(function (content) {\n+                content.must.equal(\n+                    '.block { background-image: url(\"freeze/Ck1VqNd45QIvq3AZd8XYQLvEhtA.gif\"); }');\n+            });\n+        });\n+\n+        it('must replace links in css file with minify and freeze options together', function () {\n+            var scheme = {\n+                    configFile: {\n+                        freeze_paths: {\n+                            '**/*': 'freeze'\n+                        }\n+                    },\n+                    'image.gif': new Buffer('Hello World'),\n+                    'bundle.css': '.block { background-image: url(\"image.gif\"); }'\n+                },\n+                options = mergeConfigs(baseOptions, {\n+                    minify: true,\n+                    freeze: true\n+                });\n+\n+            return build(scheme, options).then(function (content) {\n+                content.must.equal(\n+                    '.block{background-image:url(\"freeze/Ck1VqNd45QIvq3AZd8XYQLvEhtA.gif\")}');\n+            });\n+        });\n+\n+        it('must properly work with given tech (cleancss)', function () {\n+            var scheme = {\n+                    configFile: {\n+                        freeze_paths: {\n+                            '**/*': 'freeze'\n+                        }\n+                    },\n+                    'image.gif': new Buffer('Hello World'),\n+                    'extra.css': 'a { background:url(../partials/extra/down.gif) 0 0 no-repeat;}',","path":"test/techs/borschik.test.js","position":129,"original_position":129,"commit_id":"5e4ff7c9588f58ce02aabbf8540b32c2cafd22a2","original_commit_id":"5e4ff7c9588f58ce02aabbf8540b32c2cafd22a2","user":{"login":"sipayRT","id":1658415,"avatar_url":"https://avatars.githubusercontent.com/u/1658415?v=3","gravatar_id":"","url":"https://api.github.com/users/sipayRT","html_url":"https://github.com/sipayRT","followers_url":"https://api.github.com/users/sipayRT/followers","following_url":"https://api.github.com/users/sipayRT/following{/other_user}","gists_url":"https://api.github.com/users/sipayRT/gists{/gist_id}","starred_url":"https://api.github.com/users/sipayRT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipayRT/subscriptions","organizations_url":"https://api.github.com/users/sipayRT/orgs","repos_url":"https://api.github.com/users/sipayRT/repos","events_url":"https://api.github.com/users/sipayRT/events{/privacy}","received_events_url":"https://api.github.com/users/sipayRT/received_events","type":"User","site_admin":false},"body":"после двоеточия пробел лучше оставить (для наглядности)","created_at":"2015-06-25T15:08:49Z","updated_at":"2015-06-25T15:08:49Z","html_url":"https://github.com/enb-make/enb-borschik/pull/21#discussion_r33265310","pull_request_url":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/enb-make/enb-borschik/pulls/comments/33265310"},"html":{"href":"https://github.com/enb-make/enb-borschik/pull/21#discussion_r33265310"},"pull_request":{"href":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21","id":38553515,"html_url":"https://github.com/enb-make/enb-borschik/pull/21","diff_url":"https://github.com/enb-make/enb-borschik/pull/21.diff","patch_url":"https://github.com/enb-make/enb-borschik/pull/21.patch","issue_url":"https://api.github.com/repos/enb-make/enb-borschik/issues/21","number":21,"state":"open","locked":false,"title":"Issue 18 Implement tests for borschik technology","user":{"login":"tormozz48","id":996162,"avatar_url":"https://avatars.githubusercontent.com/u/996162?v=3","gravatar_id":"","url":"https://api.github.com/users/tormozz48","html_url":"https://github.com/tormozz48","followers_url":"https://api.github.com/users/tormozz48/followers","following_url":"https://api.github.com/users/tormozz48/following{/other_user}","gists_url":"https://api.github.com/users/tormozz48/gists{/gist_id}","starred_url":"https://api.github.com/users/tormozz48/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tormozz48/subscriptions","organizations_url":"https://api.github.com/users/tormozz48/orgs","repos_url":"https://api.github.com/users/tormozz48/repos","events_url":"https://api.github.com/users/tormozz48/events{/privacy}","received_events_url":"https://api.github.com/users/tormozz48/received_events","type":"User","site_admin":false},"body":"Resolved #18 \r\n\r\n@blond @sipayRT @tavriaforever \r\n\r\nPlease review it","created_at":"2015-06-25T14:32:06Z","updated_at":"2015-06-25T15:08:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c89f439ce33d096f71690a8bcca971506970d53f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21/commits","review_comments_url":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21/comments","review_comment_url":"https://api.github.com/repos/enb-make/enb-borschik/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enb-make/enb-borschik/issues/21/comments","statuses_url":"https://api.github.com/repos/enb-make/enb-borschik/statuses/5e4ff7c9588f58ce02aabbf8540b32c2cafd22a2","head":{"label":"enb-make:issue-18","ref":"issue-18","sha":"5e4ff7c9588f58ce02aabbf8540b32c2cafd22a2","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":19855108,"name":"enb-borschik","full_name":"enb-make/enb-borschik","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-borschik","description":"","fork":false,"url":"https://api.github.com/repos/enb-make/enb-borschik","forks_url":"https://api.github.com/repos/enb-make/enb-borschik/forks","keys_url":"https://api.github.com/repos/enb-make/enb-borschik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enb-make/enb-borschik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enb-make/enb-borschik/teams","hooks_url":"https://api.github.com/repos/enb-make/enb-borschik/hooks","issue_events_url":"https://api.github.com/repos/enb-make/enb-borschik/issues/events{/number}","events_url":"https://api.github.com/repos/enb-make/enb-borschik/events","assignees_url":"https://api.github.com/repos/enb-make/enb-borschik/assignees{/user}","branches_url":"https://api.github.com/repos/enb-make/enb-borschik/branches{/branch}","tags_url":"https://api.github.com/repos/enb-make/enb-borschik/tags","blobs_url":"https://api.github.com/repos/enb-make/enb-borschik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enb-make/enb-borschik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enb-make/enb-borschik/git/refs{/sha}","trees_url":"https://api.github.com/repos/enb-make/enb-borschik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enb-make/enb-borschik/statuses/{sha}","languages_url":"https://api.github.com/repos/enb-make/enb-borschik/languages","stargazers_url":"https://api.github.com/repos/enb-make/enb-borschik/stargazers","contributors_url":"https://api.github.com/repos/enb-make/enb-borschik/contributors","subscribers_url":"https://api.github.com/repos/enb-make/enb-borschik/subscribers","subscription_url":"https://api.github.com/repos/enb-make/enb-borschik/subscription","commits_url":"https://api.github.com/repos/enb-make/enb-borschik/commits{/sha}","git_commits_url":"https://api.github.com/repos/enb-make/enb-borschik/git/commits{/sha}","comments_url":"https://api.github.com/repos/enb-make/enb-borschik/comments{/number}","issue_comment_url":"https://api.github.com/repos/enb-make/enb-borschik/issues/comments{/number}","contents_url":"https://api.github.com/repos/enb-make/enb-borschik/contents/{+path}","compare_url":"https://api.github.com/repos/enb-make/enb-borschik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enb-make/enb-borschik/merges","archive_url":"https://api.github.com/repos/enb-make/enb-borschik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enb-make/enb-borschik/downloads","issues_url":"https://api.github.com/repos/enb-make/enb-borschik/issues{/number}","pulls_url":"https://api.github.com/repos/enb-make/enb-borschik/pulls{/number}","milestones_url":"https://api.github.com/repos/enb-make/enb-borschik/milestones{/number}","notifications_url":"https://api.github.com/repos/enb-make/enb-borschik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enb-make/enb-borschik/labels{/name}","releases_url":"https://api.github.com/repos/enb-make/enb-borschik/releases{/id}","created_at":"2014-05-16T12:04:48Z","updated_at":"2015-01-20T10:45:40Z","pushed_at":"2015-06-25T14:32:07Z","git_url":"git://github.com/enb-make/enb-borschik.git","ssh_url":"git@github.com:enb-make/enb-borschik.git","clone_url":"https://github.com/enb-make/enb-borschik.git","svn_url":"https://github.com/enb-make/enb-borschik","homepage":null,"size":292,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":9,"forks":9,"open_issues":9,"watchers":1,"default_branch":"master"}},"base":{"label":"enb-make:master","ref":"master","sha":"8ea258149a7001a06597a57f5bfc6853c26ed964","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":19855108,"name":"enb-borschik","full_name":"enb-make/enb-borschik","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-borschik","description":"","fork":false,"url":"https://api.github.com/repos/enb-make/enb-borschik","forks_url":"https://api.github.com/repos/enb-make/enb-borschik/forks","keys_url":"https://api.github.com/repos/enb-make/enb-borschik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enb-make/enb-borschik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enb-make/enb-borschik/teams","hooks_url":"https://api.github.com/repos/enb-make/enb-borschik/hooks","issue_events_url":"https://api.github.com/repos/enb-make/enb-borschik/issues/events{/number}","events_url":"https://api.github.com/repos/enb-make/enb-borschik/events","assignees_url":"https://api.github.com/repos/enb-make/enb-borschik/assignees{/user}","branches_url":"https://api.github.com/repos/enb-make/enb-borschik/branches{/branch}","tags_url":"https://api.github.com/repos/enb-make/enb-borschik/tags","blobs_url":"https://api.github.com/repos/enb-make/enb-borschik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enb-make/enb-borschik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enb-make/enb-borschik/git/refs{/sha}","trees_url":"https://api.github.com/repos/enb-make/enb-borschik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enb-make/enb-borschik/statuses/{sha}","languages_url":"https://api.github.com/repos/enb-make/enb-borschik/languages","stargazers_url":"https://api.github.com/repos/enb-make/enb-borschik/stargazers","contributors_url":"https://api.github.com/repos/enb-make/enb-borschik/contributors","subscribers_url":"https://api.github.com/repos/enb-make/enb-borschik/subscribers","subscription_url":"https://api.github.com/repos/enb-make/enb-borschik/subscription","commits_url":"https://api.github.com/repos/enb-make/enb-borschik/commits{/sha}","git_commits_url":"https://api.github.com/repos/enb-make/enb-borschik/git/commits{/sha}","comments_url":"https://api.github.com/repos/enb-make/enb-borschik/comments{/number}","issue_comment_url":"https://api.github.com/repos/enb-make/enb-borschik/issues/comments{/number}","contents_url":"https://api.github.com/repos/enb-make/enb-borschik/contents/{+path}","compare_url":"https://api.github.com/repos/enb-make/enb-borschik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enb-make/enb-borschik/merges","archive_url":"https://api.github.com/repos/enb-make/enb-borschik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enb-make/enb-borschik/downloads","issues_url":"https://api.github.com/repos/enb-make/enb-borschik/issues{/number}","pulls_url":"https://api.github.com/repos/enb-make/enb-borschik/pulls{/number}","milestones_url":"https://api.github.com/repos/enb-make/enb-borschik/milestones{/number}","notifications_url":"https://api.github.com/repos/enb-make/enb-borschik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enb-make/enb-borschik/labels{/name}","releases_url":"https://api.github.com/repos/enb-make/enb-borschik/releases{/id}","created_at":"2014-05-16T12:04:48Z","updated_at":"2015-01-20T10:45:40Z","pushed_at":"2015-06-25T14:32:07Z","git_url":"git://github.com/enb-make/enb-borschik.git","ssh_url":"git@github.com:enb-make/enb-borschik.git","clone_url":"https://github.com/enb-make/enb-borschik.git","svn_url":"https://github.com/enb-make/enb-borschik","homepage":null,"size":292,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":9,"forks":9,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21"},"html":{"href":"https://github.com/enb-make/enb-borschik/pull/21"},"issue":{"href":"https://api.github.com/repos/enb-make/enb-borschik/issues/21"},"comments":{"href":"https://api.github.com/repos/enb-make/enb-borschik/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/enb-make/enb-borschik/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enb-make/enb-borschik/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/enb-make/enb-borschik/statuses/5e4ff7c9588f58ce02aabbf8540b32c2cafd22a2"}}}}