{"action":"created","issue":{"url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/192","labels_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/192/comments","events_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/192/events","html_url":"https://github.com/rodjek/rspec-puppet/issues/192","id":32305622,"number":192,"title":"compile matcher fails when checking classes targeting windows on posix.","user":{"login":"fessyfoo","id":1090063,"avatar_url":"https://avatars.githubusercontent.com/u/1090063?v=3","gravatar_id":"","url":"https://api.github.com/users/fessyfoo","html_url":"https://github.com/fessyfoo","followers_url":"https://api.github.com/users/fessyfoo/followers","following_url":"https://api.github.com/users/fessyfoo/following{/other_user}","gists_url":"https://api.github.com/users/fessyfoo/gists{/gist_id}","starred_url":"https://api.github.com/users/fessyfoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fessyfoo/subscriptions","organizations_url":"https://api.github.com/users/fessyfoo/orgs","repos_url":"https://api.github.com/users/fessyfoo/repos","events_url":"https://api.github.com/users/fessyfoo/events{/privacy}","received_events_url":"https://api.github.com/users/fessyfoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-04-27T06:33:52Z","updated_at":"2015-06-15T09:24:37Z","closed_at":null,"body":"We're trying to  use the compile matcher on all of our role classes. Our puppetmaster serves windows and linux nodes.   each node definition has one role class assigned.\r\n\r\nwhen trying to compile a windows role, on a ci linux or dev osx machine.  there's inevitably a File resource with a path of the form: `C:\\foo.txt`   rspec-puppet fails to compile the class because `File paths must be fully qualified, not 'C:\\foo.txt'`  \r\n\r\nAny guidance on how to resolve this would be greatly appreciated. \r\n\r\nfor those interested I've created a sample project which illustrates the issue:\r\n\r\n   https://github.com/fessyfoo/rspec-puppet-windows-issue\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/comments/111990462","html_url":"https://github.com/rodjek/rspec-puppet/issues/192#issuecomment-111990462","issue_url":"https://api.github.com/repos/rodjek/rspec-puppet/issues/192","id":111990462,"user":{"login":"DavidS","id":27712,"avatar_url":"https://avatars.githubusercontent.com/u/27712?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidS","html_url":"https://github.com/DavidS","followers_url":"https://api.github.com/users/DavidS/followers","following_url":"https://api.github.com/users/DavidS/following{/other_user}","gists_url":"https://api.github.com/users/DavidS/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidS/subscriptions","organizations_url":"https://api.github.com/users/DavidS/orgs","repos_url":"https://api.github.com/users/DavidS/repos","events_url":"https://api.github.com/users/DavidS/events{/privacy}","received_events_url":"https://api.github.com/users/DavidS/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T09:24:37Z","updated_at":"2015-06-15T09:24:37Z","body":"I've delved deeper into this issue. `puppet master --compile` creates only a so-called 'resource catalog', which is the server-side representation to facilitate network serialization. This does not call into any of the validation methods nor creates a \"proper\" resource graph.\r\n\r\nrspec-puppet on the other hand, needs the resource graph and therefore acts like an agent and converts the resource catalog in a RAL catalog. This starts calling into actual types and therefore hits this validation.\r\n\r\nThis is documented in https://github.com/puppetlabs/puppet/blob/master/docs/catalogs.md\r\n\r\nStubbing `Puppet::Util::Platform.windows?`, as @drrb can only be a start in this case. On the puppet side alone, there is also `Puppet.features.microsoft_windows?` which needs to be considered. Finally, all types that are used by the catalog need to be checked for things where they access system specific runtime behaviour.\r\n\r\nIn the end it might be easier to run rspec on an actual windows system for these cases. rspec's metadata support might help here to select tests based on platform."}}