{"action":"created","comment":{"url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/comments/69721023","id":69721023,"diff_hunk":"@@ -0,0 +1,91 @@\n+require_relative \"spec_helper.rb\"\n+require \"update-alternatives/UI/alternative_dialog\"\n+require \"update-alternatives/model/alternative\"\n+\n+describe UpdateAlternatives::AlternativeDialog do\n+  def mock_ui_events(*events)\n+    allow(Yast::UI).to receive(:UserInput).and_return(*events)\n+  end\n+\n+  def simulate_the_change_of_selected_choice\n+    allow(Yast::UI).to receive(:QueryWidget).with(:choices_table, :CurrentItem)\n+      .and_return(alternative.value, \"/usr/bin/vim\")\n+  end\n+\n+  before do\n+    allow(Yast::UI).to receive(:OpenDialog).and_return(true)\n+    allow(Yast::UI).to receive(:CloseDialog).and_return(true)\n+    allow(Yast::UI).to receive(:QueryWidget).with(:choices_table, :CurrentItem)\n+      .and_return(alternative.value)\n+  end\n+\n+  subject(:alternative) do\n+    UpdateAlternatives::Alternative.new(\n+      \"editor\",\n+      \"manual\",\n+      \"/usr/bin/nano\",\n+      [\n+        UpdateAlternatives::Alternative::Choice.new(\"/usr/bin/nano\", \"20\", \"nano slaves\\n line2\"),\n+        UpdateAlternatives::Alternative::Choice.new(\"/usr/bin/vim\", \"30\", \"vim slaves\\n line2\")\n+      ]\n+    )\n+  end\n+\n+  describe \"#run\" do\n+    it \"selects the Alternative's current choice and show his slaves\" do\n+      expect(Yast::UI).to receive(:ChangeWidget)\n+        .with(:choices_table, :CurrentItem, alternative.value)\n+      expect(Yast::UI).to receive(:ChangeWidget)\n+        .with(:slaves, :Value, \"<pre>\" + alternative.choices.first.slaves + \"</pre>\")\n+      mock_ui_events(:cancel)\n+      UpdateAlternatives::AlternativeDialog.new(alternative).run\n+    end\n+  end\n+\n+  describe \"#auto_handler\" do\n+    it \"calls Alternative#automatic_mode!\" do\n+      mock_ui_events(:auto)\n+      expect(alternative).to receive(:automatic_mode!)\n+      UpdateAlternatives::AlternativeDialog.new(alternative).run\n+    end","path":"test/alternative_dialog_spec.rb","position":50,"original_position":50,"commit_id":"11305d9426f95b3d302ca3c7feb61d5782ee132f","original_commit_id":"11305d9426f95b3d302ca3c7feb61d5782ee132f","user":{"login":"ancorgs","id":3638289,"avatar_url":"https://avatars.githubusercontent.com/u/3638289?v=3","gravatar_id":"","url":"https://api.github.com/users/ancorgs","html_url":"https://github.com/ancorgs","followers_url":"https://api.github.com/users/ancorgs/followers","following_url":"https://api.github.com/users/ancorgs/following{/other_user}","gists_url":"https://api.github.com/users/ancorgs/gists{/gist_id}","starred_url":"https://api.github.com/users/ancorgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ancorgs/subscriptions","organizations_url":"https://api.github.com/users/ancorgs/orgs","repos_url":"https://api.github.com/users/ancorgs/repos","events_url":"https://api.github.com/users/ancorgs/events{/privacy}","received_events_url":"https://api.github.com/users/ancorgs/received_events","type":"User","site_admin":false},"body":"What about adding also?\r\n```\r\nit \"closes the dialog\" do\r\n ...\r\nend\r\n```","created_at":"2016-07-06T12:31:27Z","updated_at":"2016-07-06T12:31:27Z","html_url":"https://github.com/yast/yast-update-alternatives/pull/15#discussion_r69721023","pull_request_url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/comments/69721023"},"html":{"href":"https://github.com/yast/yast-update-alternatives/pull/15#discussion_r69721023"},"pull_request":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15","id":76409031,"html_url":"https://github.com/yast/yast-update-alternatives/pull/15","diff_url":"https://github.com/yast/yast-update-alternatives/pull/15.diff","patch_url":"https://github.com/yast/yast-update-alternatives/pull/15.patch","issue_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues/15","number":15,"state":"open","locked":false,"title":"Testing UI","user":{"login":"jyeray","id":14922248,"avatar_url":"https://avatars.githubusercontent.com/u/14922248?v=3","gravatar_id":"","url":"https://api.github.com/users/jyeray","html_url":"https://github.com/jyeray","followers_url":"https://api.github.com/users/jyeray/followers","following_url":"https://api.github.com/users/jyeray/following{/other_user}","gists_url":"https://api.github.com/users/jyeray/gists{/gist_id}","starred_url":"https://api.github.com/users/jyeray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyeray/subscriptions","organizations_url":"https://api.github.com/users/jyeray/orgs","repos_url":"https://api.github.com/users/jyeray/repos","events_url":"https://api.github.com/users/jyeray/events{/privacy}","received_events_url":"https://api.github.com/users/jyeray/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-06T10:16:56Z","updated_at":"2016-07-06T12:31:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"120c4a575902c7a0d77bc6015c052b9bc9ba987b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15/commits","review_comments_url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15/comments","review_comment_url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues/15/comments","statuses_url":"https://api.github.com/repos/yast/yast-update-alternatives/statuses/11305d9426f95b3d302ca3c7feb61d5782ee132f","head":{"label":"yast:test_ui","ref":"test_ui","sha":"11305d9426f95b3d302ca3c7feb61d5782ee132f","user":{"login":"yast","id":909990,"avatar_url":"https://avatars.githubusercontent.com/u/909990?v=3","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"repo":{"id":59286017,"name":"yast-update-alternatives","full_name":"yast/yast-update-alternatives","owner":{"login":"yast","id":909990,"avatar_url":"https://avatars.githubusercontent.com/u/909990?v=3","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yast/yast-update-alternatives","description":"Module to manage update alternatives switching","fork":false,"url":"https://api.github.com/repos/yast/yast-update-alternatives","forks_url":"https://api.github.com/repos/yast/yast-update-alternatives/forks","keys_url":"https://api.github.com/repos/yast/yast-update-alternatives/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yast/yast-update-alternatives/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yast/yast-update-alternatives/teams","hooks_url":"https://api.github.com/repos/yast/yast-update-alternatives/hooks","issue_events_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues/events{/number}","events_url":"https://api.github.com/repos/yast/yast-update-alternatives/events","assignees_url":"https://api.github.com/repos/yast/yast-update-alternatives/assignees{/user}","branches_url":"https://api.github.com/repos/yast/yast-update-alternatives/branches{/branch}","tags_url":"https://api.github.com/repos/yast/yast-update-alternatives/tags","blobs_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/refs{/sha}","trees_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yast/yast-update-alternatives/statuses/{sha}","languages_url":"https://api.github.com/repos/yast/yast-update-alternatives/languages","stargazers_url":"https://api.github.com/repos/yast/yast-update-alternatives/stargazers","contributors_url":"https://api.github.com/repos/yast/yast-update-alternatives/contributors","subscribers_url":"https://api.github.com/repos/yast/yast-update-alternatives/subscribers","subscription_url":"https://api.github.com/repos/yast/yast-update-alternatives/subscription","commits_url":"https://api.github.com/repos/yast/yast-update-alternatives/commits{/sha}","git_commits_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/commits{/sha}","comments_url":"https://api.github.com/repos/yast/yast-update-alternatives/comments{/number}","issue_comment_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues/comments{/number}","contents_url":"https://api.github.com/repos/yast/yast-update-alternatives/contents/{+path}","compare_url":"https://api.github.com/repos/yast/yast-update-alternatives/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yast/yast-update-alternatives/merges","archive_url":"https://api.github.com/repos/yast/yast-update-alternatives/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yast/yast-update-alternatives/downloads","issues_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues{/number}","pulls_url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls{/number}","milestones_url":"https://api.github.com/repos/yast/yast-update-alternatives/milestones{/number}","notifications_url":"https://api.github.com/repos/yast/yast-update-alternatives/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yast/yast-update-alternatives/labels{/name}","releases_url":"https://api.github.com/repos/yast/yast-update-alternatives/releases{/id}","deployments_url":"https://api.github.com/repos/yast/yast-update-alternatives/deployments","created_at":"2016-05-20T10:28:45Z","updated_at":"2016-05-24T09:52:59Z","pushed_at":"2016-07-06T11:29:23Z","git_url":"git://github.com/yast/yast-update-alternatives.git","ssh_url":"git@github.com:yast/yast-update-alternatives.git","clone_url":"https://github.com/yast/yast-update-alternatives.git","svn_url":"https://github.com/yast/yast-update-alternatives","homepage":null,"size":105,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"yast:master","ref":"master","sha":"0c53e831ad02a7eba02c8af5420e3bd27003e88a","user":{"login":"yast","id":909990,"avatar_url":"https://avatars.githubusercontent.com/u/909990?v=3","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"repo":{"id":59286017,"name":"yast-update-alternatives","full_name":"yast/yast-update-alternatives","owner":{"login":"yast","id":909990,"avatar_url":"https://avatars.githubusercontent.com/u/909990?v=3","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yast/yast-update-alternatives","description":"Module to manage update alternatives switching","fork":false,"url":"https://api.github.com/repos/yast/yast-update-alternatives","forks_url":"https://api.github.com/repos/yast/yast-update-alternatives/forks","keys_url":"https://api.github.com/repos/yast/yast-update-alternatives/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yast/yast-update-alternatives/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yast/yast-update-alternatives/teams","hooks_url":"https://api.github.com/repos/yast/yast-update-alternatives/hooks","issue_events_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues/events{/number}","events_url":"https://api.github.com/repos/yast/yast-update-alternatives/events","assignees_url":"https://api.github.com/repos/yast/yast-update-alternatives/assignees{/user}","branches_url":"https://api.github.com/repos/yast/yast-update-alternatives/branches{/branch}","tags_url":"https://api.github.com/repos/yast/yast-update-alternatives/tags","blobs_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/refs{/sha}","trees_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yast/yast-update-alternatives/statuses/{sha}","languages_url":"https://api.github.com/repos/yast/yast-update-alternatives/languages","stargazers_url":"https://api.github.com/repos/yast/yast-update-alternatives/stargazers","contributors_url":"https://api.github.com/repos/yast/yast-update-alternatives/contributors","subscribers_url":"https://api.github.com/repos/yast/yast-update-alternatives/subscribers","subscription_url":"https://api.github.com/repos/yast/yast-update-alternatives/subscription","commits_url":"https://api.github.com/repos/yast/yast-update-alternatives/commits{/sha}","git_commits_url":"https://api.github.com/repos/yast/yast-update-alternatives/git/commits{/sha}","comments_url":"https://api.github.com/repos/yast/yast-update-alternatives/comments{/number}","issue_comment_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues/comments{/number}","contents_url":"https://api.github.com/repos/yast/yast-update-alternatives/contents/{+path}","compare_url":"https://api.github.com/repos/yast/yast-update-alternatives/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yast/yast-update-alternatives/merges","archive_url":"https://api.github.com/repos/yast/yast-update-alternatives/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yast/yast-update-alternatives/downloads","issues_url":"https://api.github.com/repos/yast/yast-update-alternatives/issues{/number}","pulls_url":"https://api.github.com/repos/yast/yast-update-alternatives/pulls{/number}","milestones_url":"https://api.github.com/repos/yast/yast-update-alternatives/milestones{/number}","notifications_url":"https://api.github.com/repos/yast/yast-update-alternatives/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yast/yast-update-alternatives/labels{/name}","releases_url":"https://api.github.com/repos/yast/yast-update-alternatives/releases{/id}","deployments_url":"https://api.github.com/repos/yast/yast-update-alternatives/deployments","created_at":"2016-05-20T10:28:45Z","updated_at":"2016-05-24T09:52:59Z","pushed_at":"2016-07-06T11:29:23Z","git_url":"git://github.com/yast/yast-update-alternatives.git","ssh_url":"git@github.com:yast/yast-update-alternatives.git","clone_url":"https://github.com/yast/yast-update-alternatives.git","svn_url":"https://github.com/yast/yast-update-alternatives","homepage":null,"size":105,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15"},"html":{"href":"https://github.com/yast/yast-update-alternatives/pull/15"},"issue":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/issues/15"},"comments":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/yast/yast-update-alternatives/statuses/11305d9426f95b3d302ca3c7feb61d5782ee132f"}}}}
{"actor":{"display_login":"ancorgs"}}