{"action":"created","issue":{"url":"https://api.github.com/repos/chef/inspec/issues/288","labels_url":"https://api.github.com/repos/chef/inspec/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/chef/inspec/issues/288/comments","events_url":"https://api.github.com/repos/chef/inspec/issues/288/events","html_url":"https://github.com/chef/inspec/issues/288","id":120276889,"number":288,"title":"Windows file matcher does not match existing files","user":{"login":"cheesesashimi","id":1221263,"avatar_url":"https://avatars.githubusercontent.com/u/1221263?v=3","gravatar_id":"","url":"https://api.github.com/users/cheesesashimi","html_url":"https://github.com/cheesesashimi","followers_url":"https://api.github.com/users/cheesesashimi/followers","following_url":"https://api.github.com/users/cheesesashimi/following{/other_user}","gists_url":"https://api.github.com/users/cheesesashimi/gists{/gist_id}","starred_url":"https://api.github.com/users/cheesesashimi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheesesashimi/subscriptions","organizations_url":"https://api.github.com/users/cheesesashimi/orgs","repos_url":"https://api.github.com/users/cheesesashimi/repos","events_url":"https://api.github.com/users/cheesesashimi/events{/privacy}","received_events_url":"https://api.github.com/users/cheesesashimi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-03T21:44:16Z","updated_at":"2015-12-04T21:17:08Z","closed_at":null,"body":"This may not be the most appropriate place for this, so my apologies in advance :).\r\n\r\nI think the Windows file matcher in inspec is not working as intended. For some reason, it cannot match any file paths I provide. It appears to make no difference whether the files were put in place by Chef or if the files were already present on the Windows system under test. \r\n\r\nI was able to verify that other matchers such as `user` and `os` work correctly in Windows as evidenced in my [inspec specification](https://github.com/cheesesashimi/test-cookbook/blob/master/test/integration/default/test_spec.rb).\r\n\r\nThe output I get from kitchen and inspec is as follows:\r\n\r\n```\r\n-----> Verifying <default-win2012r2>...\r\n....F.F.\r\n\r\nFailures:\r\n\r\n  1) File C:\\Windows should exist\r\n     Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }\r\n       expected File C:\\Windows to exist\r\n     # ./test/integration/default/test_spec.rb:18:in `block (2 levels) in load'\r\n\r\n  2) File C:\\motd should exist\r\n     Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }\r\n       expected File C:\\motd to exist\r\n     # ./test/integration/default/test_spec.rb:23:in `block (2 levels) in load'\r\n\r\nFinished in 24.73 seconds (files took 2 minutes 9.2 seconds to load)\r\n8 examples, 2 failures\r\n\r\nFailed examples:\r\n\r\nrspec  # File C:\\Windows should exist\r\nrspec  # File C:\\motd should exist\r\n\r\n       Finished verifying <default-win2012r2> (0m25.76s).\r\n```\r\n\r\nI created a [simple cookbook](https://github.com/cheesesashimi/test-cookbook) in an attempt to isolate this, so it is possible my .kitchen.yml and other setup of the cookbook is incorrect.\r\n\r\nI'm happy to help debug this further, so please let me know if there is additional information I can provide that might be useful :)."},"comment":{"url":"https://api.github.com/repos/chef/inspec/issues/comments/162084008","html_url":"https://github.com/chef/inspec/issues/288#issuecomment-162084008","issue_url":"https://api.github.com/repos/chef/inspec/issues/288","id":162084008,"user":{"login":"docwhat","id":40799,"avatar_url":"https://avatars.githubusercontent.com/u/40799?v=3","gravatar_id":"","url":"https://api.github.com/users/docwhat","html_url":"https://github.com/docwhat","followers_url":"https://api.github.com/users/docwhat/followers","following_url":"https://api.github.com/users/docwhat/following{/other_user}","gists_url":"https://api.github.com/users/docwhat/gists{/gist_id}","starred_url":"https://api.github.com/users/docwhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docwhat/subscriptions","organizations_url":"https://api.github.com/users/docwhat/orgs","repos_url":"https://api.github.com/users/docwhat/repos","events_url":"https://api.github.com/users/docwhat/events{/privacy}","received_events_url":"https://api.github.com/users/docwhat/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T21:17:08Z","updated_at":"2015-12-04T21:17:08Z","body":"In your example, it looks like `be_file` and `be_directory` work, but `exists` is broken. Which is weird.\r\n\r\nI'm having a hard time following where the actual `file` object is located to figure out how it is actually trying to resolve `exist?`... I see [this bit of meta-programming](https://github.com/chef/inspec/blob/master/lib/resources/file.rb#L28-L37)... which actually looks suspicious, but I couldn't say why."}}