{"action":"created","comment":{"url":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/comments/211570142","pull_request_review_id":148015852,"id":211570142,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTU3MDE0Mg==","diff_hunk":"@@ -45,10 +37,128 @@\n       allow(domain).to receive(:data_products)\n     end\n \n-    it 'skips actions in skip_actions' do\n-      expect(GoodData::LCM2::CollectSegments).not_to receive(:call)\n-      expect(GoodData::LCM2::SynchronizeUsers).not_to receive(:call)\n-      GoodData::LCM2.perform('users', params)\n+    context 'when skip_actions specified' do\n+      let(:params) do\n+        params = {\n+          skip_actions: %w(CollectSegments SynchronizeUsers),\n+          GDC_GD_CLIENT: client,\n+          GDC_LOGGER: logger,\n+          domain: domain\n+        }\n+        GoodData::LCM2.convert_to_smart_hash(params)\n+      end\n+\n+      it 'skips actions in skip_actions' do\n+        expect(GoodData::LCM2::CollectSegments).not_to receive(:call)\n+        expect(GoodData::LCM2::SynchronizeUsers).not_to receive(:call)\n+        GoodData::LCM2.perform('users', params)\n+      end\n+    end\n+\n+    context 'when domain is not specified in params' do\n+      let(:params) do\n+        params = {\n+          GDC_GD_CLIENT: client,\n+          GDC_LOGGER: logger\n+        }\n+        expect { raise RuntimeError }.to raise_error\n+        GoodData::LCM2.convert_to_smart_hash(params)\n+      end\n+\n+      it 'exception should be thrown' do\n+        expect do\n+          GoodData::LCM2.perform('users', params)\n+        end.to raise_error { |e| expect(e.message).to include('Either organisation or domain has to be specified in params') }\n+      end\n+    end\n+\n+    context 'when mandatory params are given and hello action is performed' do\n+      let(:params) do\n+        params = {\n+          GDC_LOGGER: logger,\n+          message: 'Ahoj'\n+        }\n+        GoodData::LCM2.convert_to_smart_hash(params)\n+      end\n+\n+      it 'should finish successfully' do\n+        result = GoodData::LCM2.perform('hello', params)\n+        pp result\n+        expect(result[:actions]).to eq(['HelloWorld'])\n+        expect(result[:results][\"HelloWorld\"][0][:message]).to eq('Ahoj')\n+        expect(result[:params][:message]).to eq('Ahoj')\n+        expect(result[:params][:gdc_logger]).to eq(logger)\n+        expect(result[:params][:iterations]).to eq(1)\n+      end\n+    end\n+\n+    context 'when invalid mode is specified' do\n+      let(:params) do\n+        params = {\n+          GDC_LOGGER: logger\n+        }\n+        GoodData::LCM2.convert_to_smart_hash(params)\n+      end\n+\n+      it 'should throw exception' do\n+        expect do\n+          GoodData::LCM2.perform('invalid', params)\n+        end.to raise_error { |e| expect(e.message).to include('Invalid mode specified \\'invalid\\'') }\n+      end\n+    end\n+\n+    [true, false].each do |fail_early|\n+      [true, false].each do |strict_mode|\n+        context \"when fail_early is #{fail_early}, strict_mode is #{strict_mode} and error occurs\" do\n+          let(:params) do\n+            params = {\n+              GDC_LOGGER: logger,\n+              fail_early: fail_early,\n+              strict: strict_mode\n+            }\n+            GoodData::LCM2.convert_to_smart_hash(params)\n+          end\n+\n+          # Test class 1\n+          class Action1 < GoodData::LCM2::BaseAction\n+            PARAMS = {}\n+            DESCRIPTION = \"Test action\"\n+          end\n+\n+          # Test class 2\n+          class Action2 < Action1","path":"spec/unit/lcm/lcm2_spec.rb","position":118,"original_position":118,"commit_id":"84bf1825622dc19be08c893924753d4ecc8d264c","original_commit_id":"84bf1825622dc19be08c893924753d4ecc8d264c","user":{"login":"yenkins","id":1506393,"node_id":"MDQ6VXNlcjE1MDYzOTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1506393?v=4","gravatar_id":"","url":"https://api.github.com/users/yenkins","html_url":"https://github.com/yenkins","followers_url":"https://api.github.com/users/yenkins/followers","following_url":"https://api.github.com/users/yenkins/following{/other_user}","gists_url":"https://api.github.com/users/yenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/yenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenkins/subscriptions","organizations_url":"https://api.github.com/users/yenkins/orgs","repos_url":"https://api.github.com/users/yenkins/repos","events_url":"https://api.github.com/users/yenkins/events{/privacy}","received_events_url":"https://api.github.com/users/yenkins/received_events","type":"User","site_admin":false},"body":"info: Has the name 'action2' (UncommunicativeModuleName) (reek)","created_at":"2018-08-21T11:30:14Z","updated_at":"2018-08-21T11:30:15Z","html_url":"https://github.com/gooddata/gooddata-ruby/pull/1272#discussion_r211570142","pull_request_url":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/comments/211570142"},"html":{"href":"https://github.com/gooddata/gooddata-ruby/pull/1272#discussion_r211570142"},"pull_request":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272"}}},"pull_request":{"url":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272","id":209788714,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5Nzg4NzE0","html_url":"https://github.com/gooddata/gooddata-ruby/pull/1272","diff_url":"https://github.com/gooddata/gooddata-ruby/pull/1272.diff","patch_url":"https://github.com/gooddata/gooddata-ruby/pull/1272.patch","issue_url":"https://api.github.com/repos/gooddata/gooddata-ruby/issues/1272","number":1272,"state":"open","locked":false,"title":"TEST: TMA-1040 Add tests for \"perform\" method in LCM2 module","user":{"login":"sadam21","id":1049669,"node_id":"MDQ6VXNlcjEwNDk2Njk=","avatar_url":"https://avatars2.githubusercontent.com/u/1049669?v=4","gravatar_id":"","url":"https://api.github.com/users/sadam21","html_url":"https://github.com/sadam21","followers_url":"https://api.github.com/users/sadam21/followers","following_url":"https://api.github.com/users/sadam21/following{/other_user}","gists_url":"https://api.github.com/users/sadam21/gists{/gist_id}","starred_url":"https://api.github.com/users/sadam21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sadam21/subscriptions","organizations_url":"https://api.github.com/users/sadam21/orgs","repos_url":"https://api.github.com/users/sadam21/repos","events_url":"https://api.github.com/users/sadam21/events{/privacy}","received_events_url":"https://api.github.com/users/sadam21/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-21T11:06:37Z","updated_at":"2018-08-21T11:30:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2c52a82d048f515370559ac5f2d950badfdc0ea","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272/commits","review_comments_url":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272/comments","review_comment_url":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gooddata/gooddata-ruby/issues/1272/comments","statuses_url":"https://api.github.com/repos/gooddata/gooddata-ruby/statuses/84bf1825622dc19be08c893924753d4ecc8d264c","head":{"label":"sadam21:lcm2_fail_tests","ref":"lcm2_fail_tests","sha":"84bf1825622dc19be08c893924753d4ecc8d264c","user":{"login":"sadam21","id":1049669,"node_id":"MDQ6VXNlcjEwNDk2Njk=","avatar_url":"https://avatars2.githubusercontent.com/u/1049669?v=4","gravatar_id":"","url":"https://api.github.com/users/sadam21","html_url":"https://github.com/sadam21","followers_url":"https://api.github.com/users/sadam21/followers","following_url":"https://api.github.com/users/sadam21/following{/other_user}","gists_url":"https://api.github.com/users/sadam21/gists{/gist_id}","starred_url":"https://api.github.com/users/sadam21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sadam21/subscriptions","organizations_url":"https://api.github.com/users/sadam21/orgs","repos_url":"https://api.github.com/users/sadam21/repos","events_url":"https://api.github.com/users/sadam21/events{/privacy}","received_events_url":"https://api.github.com/users/sadam21/received_events","type":"User","site_admin":false},"repo":{"id":136629963,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY2Mjk5NjM=","name":"gooddata-ruby","full_name":"sadam21/gooddata-ruby","owner":{"login":"sadam21","id":1049669,"node_id":"MDQ6VXNlcjEwNDk2Njk=","avatar_url":"https://avatars2.githubusercontent.com/u/1049669?v=4","gravatar_id":"","url":"https://api.github.com/users/sadam21","html_url":"https://github.com/sadam21","followers_url":"https://api.github.com/users/sadam21/followers","following_url":"https://api.github.com/users/sadam21/following{/other_user}","gists_url":"https://api.github.com/users/sadam21/gists{/gist_id}","starred_url":"https://api.github.com/users/sadam21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sadam21/subscriptions","organizations_url":"https://api.github.com/users/sadam21/orgs","repos_url":"https://api.github.com/users/sadam21/repos","events_url":"https://api.github.com/users/sadam21/events{/privacy}","received_events_url":"https://api.github.com/users/sadam21/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sadam21/gooddata-ruby","description":"GoodData API Ruby Gem","fork":true,"url":"https://api.github.com/repos/sadam21/gooddata-ruby","forks_url":"https://api.github.com/repos/sadam21/gooddata-ruby/forks","keys_url":"https://api.github.com/repos/sadam21/gooddata-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sadam21/gooddata-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sadam21/gooddata-ruby/teams","hooks_url":"https://api.github.com/repos/sadam21/gooddata-ruby/hooks","issue_events_url":"https://api.github.com/repos/sadam21/gooddata-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/sadam21/gooddata-ruby/events","assignees_url":"https://api.github.com/repos/sadam21/gooddata-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/sadam21/gooddata-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/sadam21/gooddata-ruby/tags","blobs_url":"https://api.github.com/repos/sadam21/gooddata-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sadam21/gooddata-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sadam21/gooddata-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/sadam21/gooddata-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sadam21/gooddata-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/sadam21/gooddata-ruby/languages","stargazers_url":"https://api.github.com/repos/sadam21/gooddata-ruby/stargazers","contributors_url":"https://api.github.com/repos/sadam21/gooddata-ruby/contributors","subscribers_url":"https://api.github.com/repos/sadam21/gooddata-ruby/subscribers","subscription_url":"https://api.github.com/repos/sadam21/gooddata-ruby/subscription","commits_url":"https://api.github.com/repos/sadam21/gooddata-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/sadam21/gooddata-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/sadam21/gooddata-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/sadam21/gooddata-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/sadam21/gooddata-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/sadam21/gooddata-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sadam21/gooddata-ruby/merges","archive_url":"https://api.github.com/repos/sadam21/gooddata-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sadam21/gooddata-ruby/downloads","issues_url":"https://api.github.com/repos/sadam21/gooddata-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/sadam21/gooddata-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/sadam21/gooddata-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/sadam21/gooddata-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sadam21/gooddata-ruby/labels{/name}","releases_url":"https://api.github.com/repos/sadam21/gooddata-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/sadam21/gooddata-ruby/deployments","created_at":"2018-06-08T14:33:06Z","updated_at":"2018-06-08T14:33:12Z","pushed_at":"2018-08-21T11:28:43Z","git_url":"git://github.com/sadam21/gooddata-ruby.git","ssh_url":"git@github.com:sadam21/gooddata-ruby.git","clone_url":"https://github.com/sadam21/gooddata-ruby.git","svn_url":"https://github.com/sadam21/gooddata-ruby","homepage":"http://developer.gooddata.com/","size":18995,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gooddata:master","ref":"master","sha":"c405f54d6ef36dde98a80be59a81f9860f7899c5","user":{"login":"gooddata","id":291394,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTM5NA==","avatar_url":"https://avatars2.githubusercontent.com/u/291394?v=4","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"repo":{"id":891109,"node_id":"MDEwOlJlcG9zaXRvcnk4OTExMDk=","name":"gooddata-ruby","full_name":"gooddata/gooddata-ruby","owner":{"login":"gooddata","id":291394,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTM5NA==","avatar_url":"https://avatars2.githubusercontent.com/u/291394?v=4","gravatar_id":"","url":"https://api.github.com/users/gooddata","html_url":"https://github.com/gooddata","followers_url":"https://api.github.com/users/gooddata/followers","following_url":"https://api.github.com/users/gooddata/following{/other_user}","gists_url":"https://api.github.com/users/gooddata/gists{/gist_id}","starred_url":"https://api.github.com/users/gooddata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gooddata/subscriptions","organizations_url":"https://api.github.com/users/gooddata/orgs","repos_url":"https://api.github.com/users/gooddata/repos","events_url":"https://api.github.com/users/gooddata/events{/privacy}","received_events_url":"https://api.github.com/users/gooddata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gooddata/gooddata-ruby","description":"GoodData API Ruby Gem","fork":false,"url":"https://api.github.com/repos/gooddata/gooddata-ruby","forks_url":"https://api.github.com/repos/gooddata/gooddata-ruby/forks","keys_url":"https://api.github.com/repos/gooddata/gooddata-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gooddata/gooddata-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gooddata/gooddata-ruby/teams","hooks_url":"https://api.github.com/repos/gooddata/gooddata-ruby/hooks","issue_events_url":"https://api.github.com/repos/gooddata/gooddata-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/gooddata/gooddata-ruby/events","assignees_url":"https://api.github.com/repos/gooddata/gooddata-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/gooddata/gooddata-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/gooddata/gooddata-ruby/tags","blobs_url":"https://api.github.com/repos/gooddata/gooddata-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gooddata/gooddata-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gooddata/gooddata-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/gooddata/gooddata-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gooddata/gooddata-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/gooddata/gooddata-ruby/languages","stargazers_url":"https://api.github.com/repos/gooddata/gooddata-ruby/stargazers","contributors_url":"https://api.github.com/repos/gooddata/gooddata-ruby/contributors","subscribers_url":"https://api.github.com/repos/gooddata/gooddata-ruby/subscribers","subscription_url":"https://api.github.com/repos/gooddata/gooddata-ruby/subscription","commits_url":"https://api.github.com/repos/gooddata/gooddata-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/gooddata/gooddata-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/gooddata/gooddata-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/gooddata/gooddata-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/gooddata/gooddata-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/gooddata/gooddata-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gooddata/gooddata-ruby/merges","archive_url":"https://api.github.com/repos/gooddata/gooddata-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gooddata/gooddata-ruby/downloads","issues_url":"https://api.github.com/repos/gooddata/gooddata-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/gooddata/gooddata-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/gooddata/gooddata-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gooddata/gooddata-ruby/labels{/name}","releases_url":"https://api.github.com/repos/gooddata/gooddata-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/gooddata/gooddata-ruby/deployments","created_at":"2010-09-06T11:19:17Z","updated_at":"2018-08-17T18:04:07Z","pushed_at":"2018-08-21T11:28:44Z","git_url":"git://github.com/gooddata/gooddata-ruby.git","ssh_url":"git@github.com:gooddata/gooddata-ruby.git","clone_url":"https://github.com/gooddata/gooddata-ruby.git","svn_url":"https://github.com/gooddata/gooddata-ruby","homepage":"http://developer.gooddata.com/","size":18972,"stargazers_count":62,"watchers_count":62,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":92,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":92,"open_issues":28,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272"},"html":{"href":"https://github.com/gooddata/gooddata-ruby/pull/1272"},"issue":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/issues/1272"},"comments":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/issues/1272/comments"},"review_comments":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272/comments"},"review_comment":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/pulls/1272/commits"},"statuses":{"href":"https://api.github.com/repos/gooddata/gooddata-ruby/statuses/84bf1825622dc19be08c893924753d4ecc8d264c"}},"author_association":"NONE"}}
{"actor":{"display_login":"yenkins"}}