{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments/26795049","id":26795049,"diff_hunk":"@@ -21,5 +24,54 @@\n         described_class.default\n       }.to raise_error(R10K::Error, 'No Git providers are functional.')\n     end\n+\n+    it \"goes into an error state if an invalid provider was set\" do\n+      begin\n+        described_class.provider = :nope\n+      rescue R10K::Error\n+      end\n+\n+      expect {\n+        described_class.provider\n+      }.to raise_error(R10K::Error, \"No Git provider set.\")\n+    end\n+  end\n+\n+  describe 'explicitly setting the provider' do\n+    it \"raises an error if the provider doesn't exist\" do\n+      expect {\n+        described_class.provider = :nope\n+      }.to raise_error(R10K::Error, \"No Git provider named 'nope'.\")\n+    end\n+\n+    it \"raises an error if the provider isn't functional\" do\n+      expect(R10K::Features).to receive(:available?).with(:shellgit).and_return false\n+      expect {\n+        described_class.provider = :shellgit\n+      }.to raise_error(R10K::Error, \"Git provider 'shellgit' is not functional.\")\n+    end\n+\n+    it \"sets the current provider if the provider exists and is functional\" do\n+      expect(R10K::Features).to receive(:available?).with(:rugged).and_return true\n+\n+      allow(described_class).to receive(:default).and_return(:nope)\n+\n+      described_class.provider = :rugged\n+      expect(described_class.provider).to eq(R10K::Git::Rugged)\n+    end\n+  end\n+\n+  describe \"retrieving the current provider\" do\n+    it \"uses the default if a provider has not been set\" do\n+      expect(described_class).to receive(:default).and_return :def\n+      expect(described_class.provider).to eq :def\n+    end\n+\n+    it \"uses an explicitly set provider\" do\n+      expect(R10K::Features).to receive(:available?).with(:rugged).and_return true\n+      described_class.provider = :rugged\n+      expect(described_class).to_not receive(:default)\n+      expect(described_class.provider).to eq R10K::Git::Rugged\n+    end","path":"spec/unit/git_spec.rb","position":62,"original_position":62,"commit_id":"2f5ef95805de915f3316fd28b41a00fd2e0f2a12","original_commit_id":"2f5ef95805de915f3316fd28b41a00fd2e0f2a12","user":{"login":"adrienthebo","id":172194,"avatar_url":"https://avatars.githubusercontent.com/u/172194?v=3","gravatar_id":"","url":"https://api.github.com/users/adrienthebo","html_url":"https://github.com/adrienthebo","followers_url":"https://api.github.com/users/adrienthebo/followers","following_url":"https://api.github.com/users/adrienthebo/following{/other_user}","gists_url":"https://api.github.com/users/adrienthebo/gists{/gist_id}","starred_url":"https://api.github.com/users/adrienthebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrienthebo/subscriptions","organizations_url":"https://api.github.com/users/adrienthebo/orgs","repos_url":"https://api.github.com/users/adrienthebo/repos","events_url":"https://api.github.com/users/adrienthebo/events{/privacy}","received_events_url":"https://api.github.com/users/adrienthebo/received_events","type":"User","site_admin":false},"body":"Unfortunately testing `.provider=` and `.provider` is tricky because to test one you have to use the other, so there is duplication. In the earlier test I suspect that the `.default` method isn't even being called; I'll check. In the case that it doesn't exist they are entirely identical; I could delete one to resolve the duplication.","created_at":"2015-03-19T20:39:19Z","updated_at":"2015-03-19T20:39:19Z","html_url":"https://github.com/puppetlabs/r10k/pull/354#discussion_r26795049","pull_request_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/354","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments/26795049"},"html":{"href":"https://github.com/puppetlabs/r10k/pull/354#discussion_r26795049"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/354"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/r10k/pulls/354","id":31284379,"html_url":"https://github.com/puppetlabs/r10k/pull/354","diff_url":"https://github.com/puppetlabs/r10k/pull/354.diff","patch_url":"https://github.com/puppetlabs/r10k/pull/354.patch","issue_url":"https://api.github.com/repos/puppetlabs/r10k/issues/354","number":354,"state":"open","locked":false,"title":"(RK-33) User configurable git provider","user":{"login":"adrienthebo","id":172194,"avatar_url":"https://avatars.githubusercontent.com/u/172194?v=3","gravatar_id":"","url":"https://api.github.com/users/adrienthebo","html_url":"https://github.com/adrienthebo","followers_url":"https://api.github.com/users/adrienthebo/followers","following_url":"https://api.github.com/users/adrienthebo/following{/other_user}","gists_url":"https://api.github.com/users/adrienthebo/gists{/gist_id}","starred_url":"https://api.github.com/users/adrienthebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrienthebo/subscriptions","organizations_url":"https://api.github.com/users/adrienthebo/orgs","repos_url":"https://api.github.com/users/adrienthebo/repos","events_url":"https://api.github.com/users/adrienthebo/events{/privacy}","received_events_url":"https://api.github.com/users/adrienthebo/received_events","type":"User","site_admin":false},"body":"This pull request allows users to specify which Git provider they want to use. Configuration is handled in r10k.yaml with the following:\r\n\r\n```yaml\r\ngit:\r\n  provider: rugged # valid values are rugged, shellgit\r\n[...]\r\n```\r\n\r\nThis pull request is based on GH-339 and GH-351.","created_at":"2015-03-16T21:04:09Z","updated_at":"2015-03-19T20:39:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c00c098eb8e5d05e4bbac84a11ab43556468b6e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/354/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/354/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/r10k/issues/354/comments","statuses_url":"https://api.github.com/repos/puppetlabs/r10k/statuses/2f5ef95805de915f3316fd28b41a00fd2e0f2a12","head":{"label":"adrienthebo:issue/master/rk-33-git-provider-selection","ref":"issue/master/rk-33-git-provider-selection","sha":"2f5ef95805de915f3316fd28b41a00fd2e0f2a12","user":{"login":"adrienthebo","id":172194,"avatar_url":"https://avatars.githubusercontent.com/u/172194?v=3","gravatar_id":"","url":"https://api.github.com/users/adrienthebo","html_url":"https://github.com/adrienthebo","followers_url":"https://api.github.com/users/adrienthebo/followers","following_url":"https://api.github.com/users/adrienthebo/following{/other_user}","gists_url":"https://api.github.com/users/adrienthebo/gists{/gist_id}","starred_url":"https://api.github.com/users/adrienthebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrienthebo/subscriptions","organizations_url":"https://api.github.com/users/adrienthebo/orgs","repos_url":"https://api.github.com/users/adrienthebo/repos","events_url":"https://api.github.com/users/adrienthebo/events{/privacy}","received_events_url":"https://api.github.com/users/adrienthebo/received_events","type":"User","site_admin":false},"repo":{"id":28206226,"name":"r10k","full_name":"adrienthebo/r10k","owner":{"login":"adrienthebo","id":172194,"avatar_url":"https://avatars.githubusercontent.com/u/172194?v=3","gravatar_id":"","url":"https://api.github.com/users/adrienthebo","html_url":"https://github.com/adrienthebo","followers_url":"https://api.github.com/users/adrienthebo/followers","following_url":"https://api.github.com/users/adrienthebo/following{/other_user}","gists_url":"https://api.github.com/users/adrienthebo/gists{/gist_id}","starred_url":"https://api.github.com/users/adrienthebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrienthebo/subscriptions","organizations_url":"https://api.github.com/users/adrienthebo/orgs","repos_url":"https://api.github.com/users/adrienthebo/repos","events_url":"https://api.github.com/users/adrienthebo/events{/privacy}","received_events_url":"https://api.github.com/users/adrienthebo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adrienthebo/r10k","description":"Smarter Puppet deployment","fork":true,"url":"https://api.github.com/repos/adrienthebo/r10k","forks_url":"https://api.github.com/repos/adrienthebo/r10k/forks","keys_url":"https://api.github.com/repos/adrienthebo/r10k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adrienthebo/r10k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adrienthebo/r10k/teams","hooks_url":"https://api.github.com/repos/adrienthebo/r10k/hooks","issue_events_url":"https://api.github.com/repos/adrienthebo/r10k/issues/events{/number}","events_url":"https://api.github.com/repos/adrienthebo/r10k/events","assignees_url":"https://api.github.com/repos/adrienthebo/r10k/assignees{/user}","branches_url":"https://api.github.com/repos/adrienthebo/r10k/branches{/branch}","tags_url":"https://api.github.com/repos/adrienthebo/r10k/tags","blobs_url":"https://api.github.com/repos/adrienthebo/r10k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adrienthebo/r10k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adrienthebo/r10k/git/refs{/sha}","trees_url":"https://api.github.com/repos/adrienthebo/r10k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adrienthebo/r10k/statuses/{sha}","languages_url":"https://api.github.com/repos/adrienthebo/r10k/languages","stargazers_url":"https://api.github.com/repos/adrienthebo/r10k/stargazers","contributors_url":"https://api.github.com/repos/adrienthebo/r10k/contributors","subscribers_url":"https://api.github.com/repos/adrienthebo/r10k/subscribers","subscription_url":"https://api.github.com/repos/adrienthebo/r10k/subscription","commits_url":"https://api.github.com/repos/adrienthebo/r10k/commits{/sha}","git_commits_url":"https://api.github.com/repos/adrienthebo/r10k/git/commits{/sha}","comments_url":"https://api.github.com/repos/adrienthebo/r10k/comments{/number}","issue_comment_url":"https://api.github.com/repos/adrienthebo/r10k/issues/comments{/number}","contents_url":"https://api.github.com/repos/adrienthebo/r10k/contents/{+path}","compare_url":"https://api.github.com/repos/adrienthebo/r10k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adrienthebo/r10k/merges","archive_url":"https://api.github.com/repos/adrienthebo/r10k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adrienthebo/r10k/downloads","issues_url":"https://api.github.com/repos/adrienthebo/r10k/issues{/number}","pulls_url":"https://api.github.com/repos/adrienthebo/r10k/pulls{/number}","milestones_url":"https://api.github.com/repos/adrienthebo/r10k/milestones{/number}","notifications_url":"https://api.github.com/repos/adrienthebo/r10k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adrienthebo/r10k/labels{/name}","releases_url":"https://api.github.com/repos/adrienthebo/r10k/releases{/id}","created_at":"2014-12-18T23:33:44Z","updated_at":"2015-03-08T18:46:04Z","pushed_at":"2015-03-18T19:53:23Z","git_url":"git://github.com/adrienthebo/r10k.git","ssh_url":"git@github.com:adrienthebo/r10k.git","clone_url":"https://github.com/adrienthebo/r10k.git","svn_url":"https://github.com/adrienthebo/r10k","homepage":"","size":1809,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":0,"forks":5,"open_issues":0,"watchers":10,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"32622cadd9922236e6170433e2b99e0879e50dbd","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":7176141,"name":"r10k","full_name":"puppetlabs/r10k","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/r10k","description":"Smarter Puppet deployment","fork":false,"url":"https://api.github.com/repos/puppetlabs/r10k","forks_url":"https://api.github.com/repos/puppetlabs/r10k/forks","keys_url":"https://api.github.com/repos/puppetlabs/r10k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/r10k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/r10k/teams","hooks_url":"https://api.github.com/repos/puppetlabs/r10k/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/r10k/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/r10k/events","assignees_url":"https://api.github.com/repos/puppetlabs/r10k/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/r10k/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/r10k/tags","blobs_url":"https://api.github.com/repos/puppetlabs/r10k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/r10k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/r10k/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/r10k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/r10k/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/r10k/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/r10k/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/r10k/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/r10k/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/r10k/subscription","commits_url":"https://api.github.com/repos/puppetlabs/r10k/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/r10k/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/r10k/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/r10k/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/r10k/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/r10k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/r10k/merges","archive_url":"https://api.github.com/repos/puppetlabs/r10k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/r10k/downloads","issues_url":"https://api.github.com/repos/puppetlabs/r10k/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/r10k/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/r10k/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/r10k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/r10k/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/r10k/releases{/id}","created_at":"2012-12-15T05:19:38Z","updated_at":"2015-03-19T14:17:44Z","pushed_at":"2015-03-19T20:32:34Z","git_url":"git://github.com/puppetlabs/r10k.git","ssh_url":"git@github.com:puppetlabs/r10k.git","clone_url":"https://github.com/puppetlabs/r10k.git","svn_url":"https://github.com/puppetlabs/r10k","homepage":"","size":4426,"stargazers_count":406,"watchers_count":406,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":113,"mirror_url":null,"open_issues_count":58,"forks":113,"open_issues":58,"watchers":406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/354"},"html":{"href":"https://github.com/puppetlabs/r10k/pull/354"},"issue":{"href":"https://api.github.com/repos/puppetlabs/r10k/issues/354"},"comments":{"href":"https://api.github.com/repos/puppetlabs/r10k/issues/354/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/354/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/354/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/r10k/statuses/2f5ef95805de915f3316fd28b41a00fd2e0f2a12"}}}}