{"action":"created","issue":{"url":"https://api.github.com/repos/chef/inspec/issues/1326","repository_url":"https://api.github.com/repos/chef/inspec","labels_url":"https://api.github.com/repos/chef/inspec/issues/1326/labels{/name}","comments_url":"https://api.github.com/repos/chef/inspec/issues/1326/comments","events_url":"https://api.github.com/repos/chef/inspec/issues/1326/events","html_url":"https://github.com/chef/inspec/issues/1326","id":191756616,"number":1326,"title":"InSpec loads whichever *.rb file it finds along the way causing itself to fail","user":{"login":"walterdolce","id":6195629,"avatar_url":"https://avatars.githubusercontent.com/u/6195629?v=3","gravatar_id":"","url":"https://api.github.com/users/walterdolce","html_url":"https://github.com/walterdolce","followers_url":"https://api.github.com/users/walterdolce/followers","following_url":"https://api.github.com/users/walterdolce/following{/other_user}","gists_url":"https://api.github.com/users/walterdolce/gists{/gist_id}","starred_url":"https://api.github.com/users/walterdolce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterdolce/subscriptions","organizations_url":"https://api.github.com/users/walterdolce/orgs","repos_url":"https://api.github.com/users/walterdolce/repos","events_url":"https://api.github.com/users/walterdolce/events{/privacy}","received_events_url":"https://api.github.com/users/walterdolce/received_events","type":"User","site_admin":false},"labels":[{"id":441195009,"url":"https://api.github.com/repos/chef/inspec/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"chris-rock","id":1178413,"avatar_url":"https://avatars.githubusercontent.com/u/1178413?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-rock","html_url":"https://github.com/chris-rock","followers_url":"https://api.github.com/users/chris-rock/followers","following_url":"https://api.github.com/users/chris-rock/following{/other_user}","gists_url":"https://api.github.com/users/chris-rock/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-rock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-rock/subscriptions","organizations_url":"https://api.github.com/users/chris-rock/orgs","repos_url":"https://api.github.com/users/chris-rock/repos","events_url":"https://api.github.com/users/chris-rock/events{/privacy}","received_events_url":"https://api.github.com/users/chris-rock/received_events","type":"User","site_admin":false},"assignees":[{"login":"chris-rock","id":1178413,"avatar_url":"https://avatars.githubusercontent.com/u/1178413?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-rock","html_url":"https://github.com/chris-rock","followers_url":"https://api.github.com/users/chris-rock/followers","following_url":"https://api.github.com/users/chris-rock/following{/other_user}","gists_url":"https://api.github.com/users/chris-rock/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-rock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-rock/subscriptions","organizations_url":"https://api.github.com/users/chris-rock/orgs","repos_url":"https://api.github.com/users/chris-rock/repos","events_url":"https://api.github.com/users/chris-rock/events{/privacy}","received_events_url":"https://api.github.com/users/chris-rock/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-11-25T19:26:02Z","updated_at":"2016-11-25T22:53:32Z","closed_at":null,"body":"### Description\r\n\r\nI started implementing an InSpec profile and I obviously wanted to do it by adopting a BDD/TDD workflow. I have setup the components required to test various scenarios for the profile. You can have a look at the overall structure [here](https://github.com/walterdolce/inspec-profile-telnet/tree/feature/add-initial-integration-tests-setup).\r\n\r\nThe problem is simple, when running `inspec check .` from the root of the project, it picks up whatever it finds starting from that position. This means it's going to assume every `*.rb` file from that directory position will be something related to InSpec itself, when in reality really is not.\r\n\r\nThe output produced is the following:\r\n```\r\n$ inspec check .\r\n\r\nWARN: Unresolved specs during Gem::Specification.reset:\r\n      ffi (>= 1.0.1)\r\n      multi_json (~> 1.10)\r\n      rspec (~> 3)\r\nWARN: Clearing out unresolved specs.\r\nPlease report a bug if this causes problems.\r\n./test/cookbooks/gcc-installer/metadata.rb:1:in `load_with_context': undefined method `name' for #<#<Class:0x007f93eaabed90>:0x007f93eaabe4a8> (NoMethodError)\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile_context.rb:146:in `instance_eval'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile_context.rb:146:in `load_with_context'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile_context.rb:130:in `load_control_file'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:144:in `block in collect_tests'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:140:in `each'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:140:in `collect_tests'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:417:in `load_checks_params'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:410:in `load_params'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:133:in `params'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:299:in `controls_count'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/profile.rb:270:in `check'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/lib/inspec/cli.rb:68:in `check'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/inspec-1.5.0/bin/inspec:12:in `<top (required)>'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/bin/inspec:23:in `load'\r\n\tfrom /Users/{{user}}/.rbenv/versions/2.3.0/bin/inspec:23:in `<main>'\r\n```\r\n\r\n### InSpec and Platform Version\r\n\r\n```\r\n# InSpec version is 1.5.0\r\n\r\n== Operating System Details\r\n\r\nName:      mac_os_x\r\nFamily:    darwin\r\nRelease:   10.10.5\r\nArch:      x86_64\r\n```\r\n\r\n### Replication Case\r\n\r\n- Fork and clone the repository linked above\r\n- Checkout the WIP branch where I put the initial integration tests setup\r\n- `bundle install`\r\n- `inspec check .` or `bundle exec inspec check .` (depending on whether you have it installed already)\r\n\r\n### Possible Solutions\r\n\r\nInSpec should take into consideration only the `*.rb` files which pertain to the work it needs to do (just whatever is in `controls/` ? Please clarify).\r\n\r\n### Stacktrace\r\n\r\nIncluded above.\r\n"},"comment":{"url":"https://api.github.com/repos/chef/inspec/issues/comments/263030271","html_url":"https://github.com/chef/inspec/issues/1326#issuecomment-263030271","issue_url":"https://api.github.com/repos/chef/inspec/issues/1326","id":263030271,"user":{"login":"chris-rock","id":1178413,"avatar_url":"https://avatars.githubusercontent.com/u/1178413?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-rock","html_url":"https://github.com/chris-rock","followers_url":"https://api.github.com/users/chris-rock/followers","following_url":"https://api.github.com/users/chris-rock/following{/other_user}","gists_url":"https://api.github.com/users/chris-rock/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-rock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-rock/subscriptions","organizations_url":"https://api.github.com/users/chris-rock/orgs","repos_url":"https://api.github.com/users/chris-rock/repos","events_url":"https://api.github.com/users/chris-rock/events{/privacy}","received_events_url":"https://api.github.com/users/chris-rock/received_events","type":"User","site_admin":false},"created_at":"2016-11-25T22:53:32Z","updated_at":"2016-11-25T22:53:32Z","body":"@walterdolce I can confirm that issue now. The old versions of InSpec allowed placing tests in `test` directory instead of `controls`. PR #1327 is removing this behavior. Once this is merged, your code works just fine. Thank you for reporting this issue."}}
{"actor":{"display_login":"chris-rock"}}