{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/beaker/pulls/comments/27050865","id":27050865,"diff_hunk":"@@ -125,6 +121,133 @@ def expect_failure(explanation, &block)\n                  '\"expect_failure()\" needs to be removed from this test. ' +\n                  \"Additional info: '#{explanation}'\")\n       end\n+\n+      # Limit the hosts a test case is run against\n+      # @note This will modify the {Beaker::TestCase#hosts} member\n+      #   in place unless an array of hosts is passed into it and\n+      #   {Beaker::TestCase#logger} yielding an object that responds\n+      #   like {Beaker::Logger#warn}, as well as\n+      #   {Beaker::DSL::Outcomes#skip_test}, and optionally\n+      #   {Beaker::TestCase#hosts}.\n+      #\n+      # @param [Symbol] type The type of confinement to do. Valid parameters\n+      #                      are *:to* to confine the hosts to only those that\n+      #                      match *criteria* or *:except* to confine the test\n+      #                      case to only those hosts that do not match\n+      #                      criteria.\n+      # @param [Hash{Symbol,String=>String,Regexp,Array<String,Regexp>}]\n+      #   criteria Specify the criteria with which a host should be\n+      #   considered for inclusion or exclusion.  The key is any attribute\n+      #   of the host that will be yielded by {Beaker::Host#[]}.\n+      #   The value can be any string/regex or array of strings/regexp.\n+      #   The values are compared using [Enumerable#any?] so that if one\n+      #   value of an array matches the host is considered a match for that\n+      #   criteria.\n+      # @param [Array<Host>] host_array This creatively named parameter is\n+      #   an optional array of hosts to confine to.  If not passed in, this\n+      #   method will modify {Beaker::TestCase#hosts} in place.\n+      # @param [Proc] block Addition checks to determine suitability of hosts\n+      #   for confinement.  Each host that is still valid after checking\n+      #   *criteria* is then passed in turn into this block.  The block\n+      #   should return true if the host matches this additional criteria.\n+      #\n+      # @example Basic usage to confine to debian OSes.\n+      #     confine :to, :platform => 'debian'\n+      #\n+      # @example Confining to anything but Windows and Solaris\n+      #     confine :except, :platform => ['windows', 'solaris']\n+      #\n+      # @example Using additional block to confine to Solaris global zone.\n+      #     confine :to, :platform => 'solaris' do |solaris|\n+      #       on( solaris, 'zonename' ) =~ /global/\n+      #     end\n+      #\n+      # @return [Array<Host>] Returns an array of hosts that are still valid\n+      #   targets for this tests case.\n+      # @raise [SkipTest] Raises skip test if there are no valid hosts for\n+      #   this test case after confinement.\n+      def confine(type, criteria, host_array = nil, &block)\n+        hosts_to_modify = host_array || hosts\n+        case type\n+        when :except\n+          hosts_to_modify = hosts_to_modify - select_hosts(criteria, hosts_to_modify, &block)","path":"lib/beaker/dsl/structure.rb","position":85,"original_position":85,"commit_id":"73931bf3950e1df5867dbab6b0e62601d6e89b55","original_commit_id":"73931bf3950e1df5867dbab6b0e62601d6e89b55","user":{"login":"rick","id":6259,"avatar_url":"https://avatars.githubusercontent.com/u/6259?v=3","gravatar_id":"","url":"https://api.github.com/users/rick","html_url":"https://github.com/rick","followers_url":"https://api.github.com/users/rick/followers","following_url":"https://api.github.com/users/rick/following{/other_user}","gists_url":"https://api.github.com/users/rick/gists{/gist_id}","starred_url":"https://api.github.com/users/rick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick/subscriptions","organizations_url":"https://api.github.com/users/rick/orgs","repos_url":"https://api.github.com/users/rick/repos","events_url":"https://api.github.com/users/rick/events{/privacy}","received_events_url":"https://api.github.com/users/rick/received_events","type":"User","site_admin":false},"body":"Trivially, and idiomatically I might go with `-=` here instead.","created_at":"2015-03-24T17:17:44Z","updated_at":"2015-03-24T17:17:44Z","html_url":"https://github.com/puppetlabs/beaker/pull/755#discussion_r27050865","pull_request_url":"https://api.github.com/repos/puppetlabs/beaker/pulls/755","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/beaker/pulls/comments/27050865"},"html":{"href":"https://github.com/puppetlabs/beaker/pull/755#discussion_r27050865"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/beaker/pulls/755"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/beaker/pulls/755","id":31480284,"html_url":"https://github.com/puppetlabs/beaker/pull/755","diff_url":"https://github.com/puppetlabs/beaker/pull/755.diff","patch_url":"https://github.com/puppetlabs/beaker/pull/755.patch","issue_url":"https://api.github.com/repos/puppetlabs/beaker/issues/755","number":755,"state":"open","locked":false,"title":"(BKR-77) breakup dsl/helpers and dsl/install_utils","user":{"login":"anodelman","id":4140109,"avatar_url":"https://avatars.githubusercontent.com/u/4140109?v=3","gravatar_id":"","url":"https://api.github.com/users/anodelman","html_url":"https://github.com/anodelman","followers_url":"https://api.github.com/users/anodelman/followers","following_url":"https://api.github.com/users/anodelman/following{/other_user}","gists_url":"https://api.github.com/users/anodelman/gists{/gist_id}","starred_url":"https://api.github.com/users/anodelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anodelman/subscriptions","organizations_url":"https://api.github.com/users/anodelman/orgs","repos_url":"https://api.github.com/users/anodelman/repos","events_url":"https://api.github.com/users/anodelman/events{/privacy}","received_events_url":"https://api.github.com/users/anodelman/received_events","type":"User","site_admin":false},"body":"- dsl/helpers.rb and dsl/install_utils.rb have grown too large and no\r\n  longer make sense as discreet units\r\n- divide install_utils into modules with methods associated with\r\n  different applications (pe, puppet, modules)\r\n- divide helpers into modules with methods exercising different areas of\r\n  functionality (facter, hiera, host, puppet, web, trapperkeeper)\r\n- update spec testing stucture to reflect new install_utils/helpers\r\n  stucture","created_at":"2015-03-18T22:47:21Z","updated_at":"2015-03-24T17:17:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"671e5058146743f1be5d08ee4e2f0148bfad0f2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/beaker/pulls/755/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/beaker/pulls/755/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/beaker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/beaker/issues/755/comments","statuses_url":"https://api.github.com/repos/puppetlabs/beaker/statuses/73931bf3950e1df5867dbab6b0e62601d6e89b55","head":{"label":"anodelman:acceptance","ref":"acceptance","sha":"73931bf3950e1df5867dbab6b0e62601d6e89b55","user":{"login":"anodelman","id":4140109,"avatar_url":"https://avatars.githubusercontent.com/u/4140109?v=3","gravatar_id":"","url":"https://api.github.com/users/anodelman","html_url":"https://github.com/anodelman","followers_url":"https://api.github.com/users/anodelman/followers","following_url":"https://api.github.com/users/anodelman/following{/other_user}","gists_url":"https://api.github.com/users/anodelman/gists{/gist_id}","starred_url":"https://api.github.com/users/anodelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anodelman/subscriptions","organizations_url":"https://api.github.com/users/anodelman/orgs","repos_url":"https://api.github.com/users/anodelman/repos","events_url":"https://api.github.com/users/anodelman/events{/privacy}","received_events_url":"https://api.github.com/users/anodelman/received_events","type":"User","site_admin":false},"repo":{"id":12164832,"name":"beaker","full_name":"anodelman/beaker","owner":{"login":"anodelman","id":4140109,"avatar_url":"https://avatars.githubusercontent.com/u/4140109?v=3","gravatar_id":"","url":"https://api.github.com/users/anodelman","html_url":"https://github.com/anodelman","followers_url":"https://api.github.com/users/anodelman/followers","following_url":"https://api.github.com/users/anodelman/following{/other_user}","gists_url":"https://api.github.com/users/anodelman/gists{/gist_id}","starred_url":"https://api.github.com/users/anodelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anodelman/subscriptions","organizations_url":"https://api.github.com/users/anodelman/orgs","repos_url":"https://api.github.com/users/anodelman/repos","events_url":"https://api.github.com/users/anodelman/events{/privacy}","received_events_url":"https://api.github.com/users/anodelman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anodelman/beaker","description":"Puppet acceptance testing harness","fork":true,"url":"https://api.github.com/repos/anodelman/beaker","forks_url":"https://api.github.com/repos/anodelman/beaker/forks","keys_url":"https://api.github.com/repos/anodelman/beaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anodelman/beaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anodelman/beaker/teams","hooks_url":"https://api.github.com/repos/anodelman/beaker/hooks","issue_events_url":"https://api.github.com/repos/anodelman/beaker/issues/events{/number}","events_url":"https://api.github.com/repos/anodelman/beaker/events","assignees_url":"https://api.github.com/repos/anodelman/beaker/assignees{/user}","branches_url":"https://api.github.com/repos/anodelman/beaker/branches{/branch}","tags_url":"https://api.github.com/repos/anodelman/beaker/tags","blobs_url":"https://api.github.com/repos/anodelman/beaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anodelman/beaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anodelman/beaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/anodelman/beaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anodelman/beaker/statuses/{sha}","languages_url":"https://api.github.com/repos/anodelman/beaker/languages","stargazers_url":"https://api.github.com/repos/anodelman/beaker/stargazers","contributors_url":"https://api.github.com/repos/anodelman/beaker/contributors","subscribers_url":"https://api.github.com/repos/anodelman/beaker/subscribers","subscription_url":"https://api.github.com/repos/anodelman/beaker/subscription","commits_url":"https://api.github.com/repos/anodelman/beaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/anodelman/beaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/anodelman/beaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/anodelman/beaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/anodelman/beaker/contents/{+path}","compare_url":"https://api.github.com/repos/anodelman/beaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anodelman/beaker/merges","archive_url":"https://api.github.com/repos/anodelman/beaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anodelman/beaker/downloads","issues_url":"https://api.github.com/repos/anodelman/beaker/issues{/number}","pulls_url":"https://api.github.com/repos/anodelman/beaker/pulls{/number}","milestones_url":"https://api.github.com/repos/anodelman/beaker/milestones{/number}","notifications_url":"https://api.github.com/repos/anodelman/beaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anodelman/beaker/labels{/name}","releases_url":"https://api.github.com/repos/anodelman/beaker/releases{/id}","created_at":"2013-08-16T18:04:59Z","updated_at":"2015-03-18T23:15:01Z","pushed_at":"2015-03-19T21:48:36Z","git_url":"git://github.com/anodelman/beaker.git","ssh_url":"git@github.com:anodelman/beaker.git","clone_url":"https://github.com/anodelman/beaker.git","svn_url":"https://github.com/anodelman/beaker","homepage":null,"size":11301,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"38b14ef8891a250b549bd88c16bf1bedb1ac48d6","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":12164675,"name":"beaker","full_name":"puppetlabs/beaker","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/beaker","description":"Puppet Acceptance Testing Harness","fork":false,"url":"https://api.github.com/repos/puppetlabs/beaker","forks_url":"https://api.github.com/repos/puppetlabs/beaker/forks","keys_url":"https://api.github.com/repos/puppetlabs/beaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/beaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/beaker/teams","hooks_url":"https://api.github.com/repos/puppetlabs/beaker/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/beaker/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/beaker/events","assignees_url":"https://api.github.com/repos/puppetlabs/beaker/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/beaker/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/beaker/tags","blobs_url":"https://api.github.com/repos/puppetlabs/beaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/beaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/beaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/beaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/beaker/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/beaker/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/beaker/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/beaker/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/beaker/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/beaker/subscription","commits_url":"https://api.github.com/repos/puppetlabs/beaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/beaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/beaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/beaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/beaker/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/beaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/beaker/merges","archive_url":"https://api.github.com/repos/puppetlabs/beaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/beaker/downloads","issues_url":"https://api.github.com/repos/puppetlabs/beaker/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/beaker/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/beaker/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/beaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/beaker/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/beaker/releases{/id}","created_at":"2013-08-16T17:57:03Z","updated_at":"2015-03-24T02:57:03Z","pushed_at":"2015-03-24T15:28:22Z","git_url":"git://github.com/puppetlabs/beaker.git","ssh_url":"git@github.com:puppetlabs/beaker.git","clone_url":"https://github.com/puppetlabs/beaker.git","svn_url":"https://github.com/puppetlabs/beaker","homepage":"https://groups.google.com/forum/#!forum/puppet-beaker","size":16323,"stargazers_count":156,"watchers_count":156,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":123,"mirror_url":null,"open_issues_count":11,"forks":123,"open_issues":11,"watchers":156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/beaker/pulls/755"},"html":{"href":"https://github.com/puppetlabs/beaker/pull/755"},"issue":{"href":"https://api.github.com/repos/puppetlabs/beaker/issues/755"},"comments":{"href":"https://api.github.com/repos/puppetlabs/beaker/issues/755/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/beaker/pulls/755/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/beaker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/beaker/pulls/755/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/beaker/statuses/73931bf3950e1df5867dbab6b0e62601d6e89b55"}}}}