{"action":"created","issue":{"url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/577","repository_url":"https://api.github.com/repos/rodjek/rspec-puppet","labels_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/577/labels{/name}","comments_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/577/comments","events_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/577/events","html_url":"https://github.com/rodjek/rspec-puppet/issues/577","id":246439484,"number":577,"title":"Unable to test Windows specs on a Windows computer","user":{"login":"glennsarti","id":5819622,"avatar_url":"https://avatars0.githubusercontent.com/u/5819622?v=4","gravatar_id":"","url":"https://api.github.com/users/glennsarti","html_url":"https://github.com/glennsarti","followers_url":"https://api.github.com/users/glennsarti/followers","following_url":"https://api.github.com/users/glennsarti/following{/other_user}","gists_url":"https://api.github.com/users/glennsarti/gists{/gist_id}","starred_url":"https://api.github.com/users/glennsarti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennsarti/subscriptions","organizations_url":"https://api.github.com/users/glennsarti/orgs","repos_url":"https://api.github.com/users/glennsarti/repos","events_url":"https://api.github.com/users/glennsarti/events{/privacy}","received_events_url":"https://api.github.com/users/glennsarti/received_events","type":"User","site_admin":false},"labels":[{"id":144642,"url":"https://api.github.com/repos/rodjek/rspec-puppet/labels/bug","name":"bug","color":"e10c02","default":true}],"state":"closed","locked":false,"assignee":{"login":"rodjek","id":80629,"avatar_url":"https://avatars2.githubusercontent.com/u/80629?v=4","gravatar_id":"","url":"https://api.github.com/users/rodjek","html_url":"https://github.com/rodjek","followers_url":"https://api.github.com/users/rodjek/followers","following_url":"https://api.github.com/users/rodjek/following{/other_user}","gists_url":"https://api.github.com/users/rodjek/gists{/gist_id}","starred_url":"https://api.github.com/users/rodjek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodjek/subscriptions","organizations_url":"https://api.github.com/users/rodjek/orgs","repos_url":"https://api.github.com/users/rodjek/repos","events_url":"https://api.github.com/users/rodjek/events{/privacy}","received_events_url":"https://api.github.com/users/rodjek/received_events","type":"User","site_admin":false},"assignees":[{"login":"rodjek","id":80629,"avatar_url":"https://avatars2.githubusercontent.com/u/80629?v=4","gravatar_id":"","url":"https://api.github.com/users/rodjek","html_url":"https://github.com/rodjek","followers_url":"https://api.github.com/users/rodjek/followers","following_url":"https://api.github.com/users/rodjek/following{/other_user}","gists_url":"https://api.github.com/users/rodjek/gists{/gist_id}","starred_url":"https://api.github.com/users/rodjek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodjek/subscriptions","organizations_url":"https://api.github.com/users/rodjek/orgs","repos_url":"https://api.github.com/users/rodjek/repos","events_url":"https://api.github.com/users/rodjek/events{/privacy}","received_events_url":"https://api.github.com/users/rodjek/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/rodjek/rspec-puppet/milestones/11","html_url":"https://github.com/rodjek/rspec-puppet/milestone/11","labels_url":"https://api.github.com/repos/rodjek/rspec-puppet/milestones/11/labels","id":2659939,"number":11,"title":"2.6.5","description":"","creator":{"login":"rodjek","id":80629,"avatar_url":"https://avatars2.githubusercontent.com/u/80629?v=4","gravatar_id":"","url":"https://api.github.com/users/rodjek","html_url":"https://github.com/rodjek","followers_url":"https://api.github.com/users/rodjek/followers","following_url":"https://api.github.com/users/rodjek/following{/other_user}","gists_url":"https://api.github.com/users/rodjek/gists{/gist_id}","starred_url":"https://api.github.com/users/rodjek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodjek/subscriptions","organizations_url":"https://api.github.com/users/rodjek/orgs","repos_url":"https://api.github.com/users/rodjek/repos","events_url":"https://api.github.com/users/rodjek/events{/privacy}","received_events_url":"https://api.github.com/users/rodjek/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":9,"state":"open","created_at":"2017-07-25T06:25:15Z","updated_at":"2017-08-04T03:56:29Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-07-28T19:32:44Z","updated_at":"2017-08-04T03:58:52Z","closed_at":"2017-08-03T05:20:09Z","body":"rspec-puppet version 2.6.4\r\nProbably affects 2.6.0 and above though\r\n\r\nRepro:\r\nWindows 10\r\nRuby 2.4\r\n* Clone puppetlabs-chocolatey module (https://github.com/puppetlabs/puppetlabs-chocolatey)\r\n* bundle install\r\n* bundle exec rake spec\r\n* specs fail on 12 unit tests\r\n\r\nDelete/rename all tests in spec/classes folder\r\n* bundle exec rake spec\r\n* specs all pass\r\n\r\nReason:\r\nFor some unknown reason in https://github.com/puppetlabs/puppetlabs-chocolatey/blob/master/lib/puppet_x/chocolatey/chocolatey_common.rb#L20 the `Puppet::Util::Platform.windows?` is evaluating as false in the failed tests.\r\n\r\nEven though I'm doing windows tests on a windows computer, and I have not instructed rspec-puppet to impersonate a POSIX system.\r\n\r\nI believe I have narrowed down the issue to the commit https://github.com/rodjek/rspec-puppet/commit/05d4f74402866f2d1668145344771aad064dd2ee\r\n\r\nIn this line - https://github.com/rodjek/rspec-puppet/blob/master/lib/rspec-puppet/support.rb#L370 if you don't specify an `operatingsystem` fact in your facts list then it assumes your computer is POSIX.\r\n\r\nThis assumption is wrong.  If I don't specify which operating system I want, then surely it should not be pretending at all.\r\n\r\nI confirmed a workaround by adding `operatingsystem => 'windows'` at the top `facts` hash for all tests in the `spec/classes` directory, but this is not satisfactory for modules that are primarily created and tested on Windows.\r\n\r\n---\r\n\r\nAlso this pretending ability is bleeding out to other other tests.  In my case, testing for files in `classes` should not be adversely affecting tests in the `unit` folder."},"comment":{"url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/comments/320150375","html_url":"https://github.com/rodjek/rspec-puppet/issues/577#issuecomment-320150375","issue_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/577","id":320150375,"user":{"login":"rodjek","id":80629,"avatar_url":"https://avatars2.githubusercontent.com/u/80629?v=4","gravatar_id":"","url":"https://api.github.com/users/rodjek","html_url":"https://github.com/rodjek","followers_url":"https://api.github.com/users/rodjek/followers","following_url":"https://api.github.com/users/rodjek/following{/other_user}","gists_url":"https://api.github.com/users/rodjek/gists{/gist_id}","starred_url":"https://api.github.com/users/rodjek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodjek/subscriptions","organizations_url":"https://api.github.com/users/rodjek/orgs","repos_url":"https://api.github.com/users/rodjek/repos","events_url":"https://api.github.com/users/rodjek/events{/privacy}","received_events_url":"https://api.github.com/users/rodjek/received_events","type":"User","site_admin":false},"created_at":"2017-08-04T03:58:52Z","updated_at":"2017-08-04T03:58:52Z","body":"2.6.5 has been pushed to rubygems which should fix this issue"}}
{"actor":{"display_login":"rodjek"}}