{"action":"created","comment":{"url":"https://api.github.com/repos/chef/knife-windows/pulls/comments/24290248","id":24290248,"diff_hunk":"@@ -100,8 +101,20 @@\n           winrm_command_http.configure_session\n         end\n \n+        it \"should default to negotiate when on a Windows host\" do\n+          Chef::Config[:knife] = {:winrm_transport => 'plaintext'}\n+          allow(Chef::Platform).to receive(:windows?).and_return(true)\n+          expect(winrm_command_http).to receive(:load_windows_specific_gems)\n+          expect(Chef::Knife::Winrm::Session).to receive(:new).with(hash_including(:transport => :sspinegotiate)).and_call_original\n+          expect(WinRM::WinRMWebService).to receive(:new).with('http://localhost:5985/wsman', anything, anything).and_return(@winrm_session)\n+          winrm_command_http.set_defaults\n+          winrm_command_http.configure_chef\n+          winrm_command_http.configure_session\n+        end\n+\n         it \"set operation timeout\" do\n           Chef::Config[:knife] = {:winrm_transport => 'plaintext'}\n+          allow(Chef::Platform).to receive(:windows?).and_return(false)","path":"spec/unit/knife/winrm_spec.rb","position":34,"original_position":34,"commit_id":"d7df9738957cee16c7be3844fd9c4a07003c82d9","original_commit_id":"d7df9738957cee16c7be3844fd9c4a07003c82d9","user":{"login":"jdmundrawala","id":27443,"avatar_url":"https://avatars.githubusercontent.com/u/27443?v=3","gravatar_id":"","url":"https://api.github.com/users/jdmundrawala","html_url":"https://github.com/jdmundrawala","followers_url":"https://api.github.com/users/jdmundrawala/followers","following_url":"https://api.github.com/users/jdmundrawala/following{/other_user}","gists_url":"https://api.github.com/users/jdmundrawala/gists{/gist_id}","starred_url":"https://api.github.com/users/jdmundrawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdmundrawala/subscriptions","organizations_url":"https://api.github.com/users/jdmundrawala/orgs","repos_url":"https://api.github.com/users/jdmundrawala/repos","events_url":"https://api.github.com/users/jdmundrawala/events{/privacy}","received_events_url":"https://api.github.com/users/jdmundrawala/received_events","type":"User","site_admin":false},"body":"Maybe pull `allow(Chef::Platform).to receive(:windows?).and_return(false)` out into a before block?","created_at":"2015-02-07T15:56:30Z","updated_at":"2015-02-07T15:56:30Z","html_url":"https://github.com/chef/knife-windows/pull/173#discussion_r24290248","pull_request_url":"https://api.github.com/repos/chef/knife-windows/pulls/173","_links":{"self":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/comments/24290248"},"html":{"href":"https://github.com/chef/knife-windows/pull/173#discussion_r24290248"},"pull_request":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/chef/knife-windows/pulls/173","id":28855950,"html_url":"https://github.com/chef/knife-windows/pull/173","diff_url":"https://github.com/chef/knife-windows/pull/173.diff","patch_url":"https://github.com/chef/knife-windows/pull/173.patch","issue_url":"https://api.github.com/repos/chef/knife-windows/issues/173","number":173,"state":"open","locked":false,"title":"Several of the tests fail on Windows workstation","user":{"login":"smurawski","id":4006985,"avatar_url":"https://avatars.githubusercontent.com/u/4006985?v=3","gravatar_id":"","url":"https://api.github.com/users/smurawski","html_url":"https://github.com/smurawski","followers_url":"https://api.github.com/users/smurawski/followers","following_url":"https://api.github.com/users/smurawski/following{/other_user}","gists_url":"https://api.github.com/users/smurawski/gists{/gist_id}","starred_url":"https://api.github.com/users/smurawski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smurawski/subscriptions","organizations_url":"https://api.github.com/users/smurawski/orgs","repos_url":"https://api.github.com/users/smurawski/repos","events_url":"https://api.github.com/users/smurawski/events{/privacy}","received_events_url":"https://api.github.com/users/smurawski/received_events","type":"User","site_admin":false},"body":"When running chef exec rake on the project from a Windows workstation, several of the tests fail.  This is due to them expecting configuration settings of basic and plaintext, but due to the OS being Windows, it changes the transport to sspinegotiate.\r\n\r\nI added an allow to those tests to force the return of Chef::Platform.windows? to false and added a test to validate that if the workstation is Windows, that sspinegotiate is properly set.","created_at":"2015-02-07T01:31:08Z","updated_at":"2015-02-07T15:56:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cd370ba2185dab06e93e2612141c816a7cfd1f4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/knife-windows/pulls/173/commits","review_comments_url":"https://api.github.com/repos/chef/knife-windows/pulls/173/comments","review_comment_url":"https://api.github.com/repos/chef/knife-windows/pulls/comments/{number}","comments_url":"https://api.github.com/repos/chef/knife-windows/issues/173/comments","statuses_url":"https://api.github.com/repos/chef/knife-windows/statuses/d7df9738957cee16c7be3844fd9c4a07003c82d9","head":{"label":"chef:smurawski/fix_tests_for_windows_workstation","ref":"smurawski/fix_tests_for_windows_workstation","sha":"d7df9738957cee16c7be3844fd9c4a07003c82d9","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":1440272,"name":"knife-windows","full_name":"chef/knife-windows","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/knife-windows","description":"Plugin for Chef's knife tool for working with Windows nodes","fork":false,"url":"https://api.github.com/repos/chef/knife-windows","forks_url":"https://api.github.com/repos/chef/knife-windows/forks","keys_url":"https://api.github.com/repos/chef/knife-windows/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/knife-windows/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/knife-windows/teams","hooks_url":"https://api.github.com/repos/chef/knife-windows/hooks","issue_events_url":"https://api.github.com/repos/chef/knife-windows/issues/events{/number}","events_url":"https://api.github.com/repos/chef/knife-windows/events","assignees_url":"https://api.github.com/repos/chef/knife-windows/assignees{/user}","branches_url":"https://api.github.com/repos/chef/knife-windows/branches{/branch}","tags_url":"https://api.github.com/repos/chef/knife-windows/tags","blobs_url":"https://api.github.com/repos/chef/knife-windows/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/knife-windows/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/knife-windows/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/knife-windows/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/knife-windows/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/knife-windows/languages","stargazers_url":"https://api.github.com/repos/chef/knife-windows/stargazers","contributors_url":"https://api.github.com/repos/chef/knife-windows/contributors","subscribers_url":"https://api.github.com/repos/chef/knife-windows/subscribers","subscription_url":"https://api.github.com/repos/chef/knife-windows/subscription","commits_url":"https://api.github.com/repos/chef/knife-windows/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/knife-windows/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/knife-windows/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/knife-windows/issues/comments/{number}","contents_url":"https://api.github.com/repos/chef/knife-windows/contents/{+path}","compare_url":"https://api.github.com/repos/chef/knife-windows/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/knife-windows/merges","archive_url":"https://api.github.com/repos/chef/knife-windows/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/knife-windows/downloads","issues_url":"https://api.github.com/repos/chef/knife-windows/issues{/number}","pulls_url":"https://api.github.com/repos/chef/knife-windows/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/knife-windows/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/knife-windows/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/knife-windows/labels{/name}","releases_url":"https://api.github.com/repos/chef/knife-windows/releases{/id}","created_at":"2011-03-04T17:30:51Z","updated_at":"2015-02-05T13:16:18Z","pushed_at":"2015-02-07T14:57:37Z","git_url":"git://github.com/chef/knife-windows.git","ssh_url":"git@github.com:chef/knife-windows.git","clone_url":"https://github.com/chef/knife-windows.git","svn_url":"https://github.com/chef/knife-windows","homepage":"","size":1949,"stargazers_count":96,"watchers_count":96,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":84,"mirror_url":null,"open_issues_count":21,"forks":84,"open_issues":21,"watchers":96,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"301a9edfb902decf57e15ef5449940abc9dd8d58","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":1440272,"name":"knife-windows","full_name":"chef/knife-windows","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/knife-windows","description":"Plugin for Chef's knife tool for working with Windows nodes","fork":false,"url":"https://api.github.com/repos/chef/knife-windows","forks_url":"https://api.github.com/repos/chef/knife-windows/forks","keys_url":"https://api.github.com/repos/chef/knife-windows/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/knife-windows/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/knife-windows/teams","hooks_url":"https://api.github.com/repos/chef/knife-windows/hooks","issue_events_url":"https://api.github.com/repos/chef/knife-windows/issues/events{/number}","events_url":"https://api.github.com/repos/chef/knife-windows/events","assignees_url":"https://api.github.com/repos/chef/knife-windows/assignees{/user}","branches_url":"https://api.github.com/repos/chef/knife-windows/branches{/branch}","tags_url":"https://api.github.com/repos/chef/knife-windows/tags","blobs_url":"https://api.github.com/repos/chef/knife-windows/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/knife-windows/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/knife-windows/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/knife-windows/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/knife-windows/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/knife-windows/languages","stargazers_url":"https://api.github.com/repos/chef/knife-windows/stargazers","contributors_url":"https://api.github.com/repos/chef/knife-windows/contributors","subscribers_url":"https://api.github.com/repos/chef/knife-windows/subscribers","subscription_url":"https://api.github.com/repos/chef/knife-windows/subscription","commits_url":"https://api.github.com/repos/chef/knife-windows/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/knife-windows/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/knife-windows/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/knife-windows/issues/comments/{number}","contents_url":"https://api.github.com/repos/chef/knife-windows/contents/{+path}","compare_url":"https://api.github.com/repos/chef/knife-windows/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/knife-windows/merges","archive_url":"https://api.github.com/repos/chef/knife-windows/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/knife-windows/downloads","issues_url":"https://api.github.com/repos/chef/knife-windows/issues{/number}","pulls_url":"https://api.github.com/repos/chef/knife-windows/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/knife-windows/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/knife-windows/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/knife-windows/labels{/name}","releases_url":"https://api.github.com/repos/chef/knife-windows/releases{/id}","created_at":"2011-03-04T17:30:51Z","updated_at":"2015-02-05T13:16:18Z","pushed_at":"2015-02-07T14:57:37Z","git_url":"git://github.com/chef/knife-windows.git","ssh_url":"git@github.com:chef/knife-windows.git","clone_url":"https://github.com/chef/knife-windows.git","svn_url":"https://github.com/chef/knife-windows","homepage":"","size":1949,"stargazers_count":96,"watchers_count":96,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":84,"mirror_url":null,"open_issues_count":21,"forks":84,"open_issues":21,"watchers":96,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/173"},"html":{"href":"https://github.com/chef/knife-windows/pull/173"},"issue":{"href":"https://api.github.com/repos/chef/knife-windows/issues/173"},"comments":{"href":"https://api.github.com/repos/chef/knife-windows/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/chef/knife-windows/statuses/d7df9738957cee16c7be3844fd9c4a07003c82d9"}}}}