github_api_v3 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/README.md +132 -29
- data/lib/github_api_v3/client/gists.rb +75 -5
- data/lib/github_api_v3/client/gitignore.rb +33 -0
- data/lib/github_api_v3/client/markdown.rb +29 -0
- data/lib/github_api_v3/client/repos.rb +8 -5
- data/lib/github_api_v3/client/users.rb +3 -3
- data/lib/github_api_v3/client.rb +100 -8
- data/lib/github_api_v3/default.rb +5 -0
- data/lib/github_api_v3/error.rb +13 -0
- data/lib/github_api_v3/version.rb +1 -1
- data/spec/cassettes/GitHub_Client_Gists/_create_delete_gist/creates_a_gist.json +1 -1
- data/spec/cassettes/GitHub_Client_Gists/_create_delete_gist/deletes_a_gist.json +1 -1
- data/spec/cassettes/GitHub_Client_Gists/_create_gist_comment/creates_the_comment.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_create_gist_comment/returns_comment_information_after_creation.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_delete_gist_comment/deletes_the_comment.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_delete_gist_comment/returns_true_or_false.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_edit_gist_comment/edits_the_comment.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_edit_gist_comment/returns_comment_information_after_editing.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_fork_gist/forks_a_gist.json +1 -1
- data/spec/cassettes/GitHub_Client_Gists/_fork_gist/returns_false_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_gist/returns_a_404_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_gist_comment/returns_a_404_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_gist_comment/returns_a_comment.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_gist_comments/returns_a_404_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_gist_comments/returns_a_list_of_comments.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_gist_starred_/returns_false_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_gist_starred_/should_return_true_or_false.json +1 -1
- data/spec/cassettes/GitHub_Client_Gists/_star_gist/returns_false_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_star_gist/stars_a_gist.json +1 -1
- data/spec/cassettes/GitHub_Client_Gists/_unstar_gist/returns_false_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Gists/_unstar_gist/unstars_a_gist.json +1 -1
- data/spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_a_hash.json +1 -0
- data/spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_the_correct_template.json +1 -0
- data/spec/cassettes/GitHub_Client_Gitignore/_gitignore_list/returns_an_array_of_templates.json +1 -0
- data/spec/cassettes/GitHub_Client_Markdown/_markdown/returns_rendered_markdown.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/adds_a_collaborator.json +1 -1
- data/spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/removes_a_collaborator.json +1 -1
- data/spec/cassettes/GitHub_Client_Repos/_branch/returns_a_404_if_repo_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_collaborator_/returns_a_boolean.json +1 -1
- data/spec/cassettes/GitHub_Client_Repos/_collaborators/returns_a_404_if_repo_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_contributors/returns_a_404_if_repo_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_create_repo/returns_unauthorized_when_not_authorized.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_delete_repo/deletes_a_repo.json +1 -1
- data/spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_false_if_not_authorized.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_false_when_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_unauthorized_if_not_authorized.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_languages/returns_a_404_if_repo_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_org_repos/returns_a_404_if_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_org_repos/returns_a_404_if_repo_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Repos/_tags/returns_a_404_if_repo_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Users/_events/returns_a_404_for_user_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Users/_follow/follows_a_user.json +1 -1
- data/spec/cassettes/GitHub_Client_Users/_follows_/returns_false_when_not_following.json +1 -0
- data/spec/cassettes/GitHub_Client_Users/_follows_/{returns_a_boolean.json → returns_true_when_following.json} +1 -1
- data/spec/cassettes/GitHub_Client_Users/_unfollow/unfollows_a_user.json +1 -1
- data/spec/cassettes/GitHub_Client_Users/_user/returns_a_404_if_user_not_found.json +1 -0
- data/spec/cassettes/GitHub_Client_Users/keys/returns_404_for_user_not_found.json +1 -0
- data/spec/github_api_v3/client/gists_spec.rb +83 -0
- data/spec/github_api_v3/client/gitignore_spec.rb +23 -0
- data/spec/github_api_v3/client/markdown_spec.rb +12 -0
- data/spec/github_api_v3/client/repos_spec.rb +37 -1
- data/spec/github_api_v3/client/users_spec.rb +20 -5
- metadata +77 -3
@@ -1 +1 @@
|
|
1
|
-
{"http_interactions":[{"request":{"method":"delete","uri":"https://api.github.com/user/following/caseyscarborough?access_token=5d67e609aafc9f6d3abac823796afbfe85d6d7b7&login=caseyscarborough","body":{"encoding":"US-ASCII","base64_string":""},"headers":{}},"response":{"status":{"code":204,"message":"No Content"},"headers":{"Server":["GitHub.com"],"Date":["Sun, 18 Aug 2013
|
1
|
+
{"http_interactions":[{"request":{"method":"delete","uri":"https://api.github.com/user/following/caseyscarborough?access_token=5d67e609aafc9f6d3abac823796afbfe85d6d7b7&login=caseyscarborough","body":{"encoding":"US-ASCII","base64_string":""},"headers":{}},"response":{"status":{"code":204,"message":"No Content"},"headers":{"Server":["GitHub.com"],"Date":["Sun, 18 Aug 2013 12:02:21 GMT"],"Status":["204 No Content"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["4985"],"X-Ratelimit-Reset":["1376830937"],"X-Oauth-Scopes":["delete_repo, user, public_repo, repo, gist"],"X-Accepted-Oauth-Scopes":["user, user:email, user:follow, site_admin"],"X-Github-Media-Type":["github.beta; format=json"],"X-Content-Type-Options":["nosniff"],"Access-Control-Allow-Credentials":["true"],"Access-Control-Expose-Headers":["ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes"],"Access-Control-Allow-Origin":["*"],"Vary":["Accept-Encoding"]},"body":{"encoding":"UTF-8","base64_string":""},"http_version":null},"recorded_at":"Sun, 18 Aug 2013 12:01:58 GMT"}],"recorded_with":"VCR 2.5.0"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"https://api.github.com/users/098f6bcd4621d373cade4e832627b4f6?","body":{"encoding":"US-ASCII","base64_string":""},"headers":{}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Server":["GitHub.com"],"Date":["Sun, 18 Aug 2013 12:36:24 GMT"],"Content-Type":["application/json; charset=utf-8"],"Status":["404 Not Found"],"X-Ratelimit-Limit":["60"],"X-Ratelimit-Remaining":["44"],"X-Ratelimit-Reset":["1376830939"],"X-Github-Media-Type":["github.beta; format=json"],"X-Content-Type-Options":["nosniff"],"Content-Length":["23"],"Access-Control-Allow-Credentials":["true"],"Access-Control-Expose-Headers":["ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes"],"Access-Control-Allow-Origin":["*"]},"body":{"encoding":"UTF-8","base64_string":"eyJtZXNzYWdlIjoiTm90IEZvdW5kIn0=\n"},"http_version":null},"recorded_at":"Sun, 18 Aug 2013 12:36:00 GMT"}],"recorded_with":"VCR 2.5.0"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"https://api.github.com/users/098f6bcd4621d373cade4e832627b4f6/keys?","body":{"encoding":"US-ASCII","base64_string":""},"headers":{}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Server":["GitHub.com"],"Date":["Sun, 18 Aug 2013 12:37:57 GMT"],"Content-Type":["application/json; charset=utf-8"],"Status":["404 Not Found"],"X-Ratelimit-Limit":["60"],"X-Ratelimit-Remaining":["41"],"X-Ratelimit-Reset":["1376830939"],"X-Github-Media-Type":["github.beta; format=json"],"X-Content-Type-Options":["nosniff"],"Content-Length":["23"],"Access-Control-Allow-Credentials":["true"],"Access-Control-Expose-Headers":["ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes"],"Access-Control-Allow-Origin":["*"]},"body":{"encoding":"UTF-8","base64_string":"eyJtZXNzYWdlIjoiTm90IEZvdW5kIn0=\n"},"http_version":null},"recorded_at":"Sun, 18 Aug 2013 12:37:34 GMT"}],"recorded_with":"VCR 2.5.0"}
|
@@ -20,6 +20,10 @@ describe GitHub::Client::Gists do
|
|
20
20
|
it 'returns gist information' do
|
21
21
|
GitHub.gist(5928712).should be_instance_of Hash
|
22
22
|
end
|
23
|
+
|
24
|
+
it 'returns a 404 when not found' do
|
25
|
+
expect { GitHub.gist(9999999) }.to raise_error GitHub::NotFound
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
describe '.create_delete_gist', :vcr do
|
@@ -40,24 +44,103 @@ describe GitHub::Client::Gists do
|
|
40
44
|
it 'stars a gist' do
|
41
45
|
test_client.star_gist(5928712).should be_true
|
42
46
|
end
|
47
|
+
|
48
|
+
it 'returns false when not found' do
|
49
|
+
test_client.star_gist(9999999).should be_false
|
50
|
+
end
|
43
51
|
end
|
44
52
|
|
45
53
|
describe '.gist_starred?', :vcr do
|
46
54
|
it 'should return true or false' do
|
47
55
|
[true,false].should include test_client.gist_starred?(5928712)
|
48
56
|
end
|
57
|
+
|
58
|
+
it 'returns false when not found' do
|
59
|
+
test_client.gist_starred?(9999999).should be_false
|
60
|
+
end
|
49
61
|
end
|
50
62
|
|
51
63
|
describe '.unstar_gist', :vcr do
|
52
64
|
it 'unstars a gist' do
|
53
65
|
test_client.unstar_gist(5928712).should be_true
|
54
66
|
end
|
67
|
+
|
68
|
+
it 'returns false when not found' do
|
69
|
+
test_client.unstar_gist(9999999).should be_false
|
70
|
+
end
|
55
71
|
end
|
56
72
|
|
57
73
|
describe '.fork_gist', :vcr do
|
58
74
|
it 'forks a gist' do
|
59
75
|
[true,false].should include test_client.fork_gist(1133830)
|
60
76
|
end
|
77
|
+
|
78
|
+
it 'returns false when not found' do
|
79
|
+
test_client.fork_gist(9999999).should be_false
|
80
|
+
end
|
61
81
|
end
|
62
82
|
|
83
|
+
describe '.gist_comments', :vcr do
|
84
|
+
it 'returns a list of comments' do
|
85
|
+
GitHub.gist_comments(5928712).should be_instance_of Array
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'returns a 404 when not found' do
|
89
|
+
expect { GitHub.gist_comments(9999999) }.to raise_error GitHub::NotFound
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
describe '.gist_comment', :vcr do
|
94
|
+
it 'returns a comment' do
|
95
|
+
GitHub.gist_comment(5928712, 856638).should be_instance_of Hash
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'returns a 404 when not found' do
|
99
|
+
expect { GitHub.gist_comment(5928712, 856639) }.to raise_error GitHub::NotFound
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
comment_id = ""
|
104
|
+
describe '.create_gist_comment', :vcr do
|
105
|
+
it 'returns comment information after creation' do
|
106
|
+
comment = test_client.create_gist_comment(5928712, 'Awesome!')
|
107
|
+
comment_id = comment.id
|
108
|
+
comment.should be_instance_of Hash
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'creates the comment' do
|
112
|
+
GitHub.gist_comment(5928712, comment_id).should be_instance_of Hash
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
describe '.edit_gist_comment', :vcr do
|
117
|
+
it 'returns comment information after editing' do
|
118
|
+
test_client.edit_gist_comment(5928712, comment_id, 'Even more awesome!').should be_instance_of Hash
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'edits the comment' do
|
122
|
+
GitHub.gist_comment(5928712, comment_id).body == 'Even more awesome!'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
describe '.delete_gist_comment', :vcr do
|
127
|
+
it 'returns true or false' do
|
128
|
+
[true,false].should include test_client.delete_gist_comment(5928712, comment_id)
|
129
|
+
end
|
130
|
+
|
131
|
+
it 'deletes the comment' do
|
132
|
+
expect { GitHub.gist_comment(5928712, comment_id) }.to raise_error GitHub::NotFound
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
63
146
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GitHub::Client::Gitignore do
|
4
|
+
|
5
|
+
describe '.gitignore_list', :vcr do
|
6
|
+
it 'returns an array of templates' do
|
7
|
+
GitHub.gitignore_list.should be_instance_of Array
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe '.gitignore', :vcr do
|
12
|
+
let(:template) { GitHub.gitignore("Ruby") }
|
13
|
+
|
14
|
+
it 'returns a hash' do
|
15
|
+
template.should be_instance_of Hash
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'returns the correct template' do
|
19
|
+
template.name.should == "Ruby"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GitHub::Client::Markdown do
|
4
|
+
|
5
|
+
describe '.markdown', :vcr do
|
6
|
+
it 'returns rendered markdown' do
|
7
|
+
content = GitHub.markdown('# Test!')
|
8
|
+
content.should eq("<h1>\n<a name=\"test\" class=\"anchor\" href=\"#test\"><span class=\"octicon octicon-link\"></span></a>Test!</h1>")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -32,11 +32,23 @@ describe GitHub::Client::Repos do
|
|
32
32
|
it 'creates the repo' do
|
33
33
|
GitHub.repo(test_client.login, '098f6bcd4621d373cade4e832627b4f6').should be_instance_of Hash
|
34
34
|
end
|
35
|
+
|
36
|
+
it 'returns unauthorized when not authorized' do
|
37
|
+
expect { GitHub.create_repo('7ce4519eb32aa18d0917b0d407b53064') }.to raise_error GitHub::Unauthorized
|
38
|
+
end
|
35
39
|
end
|
36
40
|
|
37
41
|
describe '.delete_repo', :vcr do
|
38
42
|
it 'deletes a repo' do
|
39
|
-
[true].should include test_client.delete_repo(test_client.login,'098f6bcd4621d373cade4e832627b4f6')
|
43
|
+
[true,false].should include test_client.delete_repo(test_client.login,'098f6bcd4621d373cade4e832627b4f6')
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'returns false when not found', :vcr do
|
47
|
+
test_client.delete_repo(test_client.login,'7ce4519eb32aa18d0917b0d407b53064').should be_false
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'returns false if not authorized' do
|
51
|
+
GitHub.delete_repo('caseyscarborough','github').should be_false
|
40
52
|
end
|
41
53
|
end
|
42
54
|
|
@@ -44,18 +56,30 @@ describe GitHub::Client::Repos do
|
|
44
56
|
it 'returns an array of repos' do
|
45
57
|
GitHub.org_repos('rails').should be_instance_of Array
|
46
58
|
end
|
59
|
+
|
60
|
+
it 'returns a 404 if repo not found', :vcr do
|
61
|
+
expect { GitHub.org_repos('7ce4519eb32aa18d0917b0d407b53064') }.to raise_error GitHub::NotFound
|
62
|
+
end
|
47
63
|
end
|
48
64
|
|
49
65
|
describe '.contributors', :vcr do
|
50
66
|
it 'returns an array of contributors' do
|
51
67
|
GitHub.contributors('rails','rails').should be_instance_of Array
|
52
68
|
end
|
69
|
+
|
70
|
+
it 'returns a 404 if repo not found', :vcr do
|
71
|
+
expect { GitHub.contributors('test','7ce4519eb32aa18d0917b0d407b53064') }.to raise_error GitHub::NotFound
|
72
|
+
end
|
53
73
|
end
|
54
74
|
|
55
75
|
describe '.languages', :vcr do
|
56
76
|
it 'returns a hash of languages' do
|
57
77
|
GitHub.languages('rails','rails').should be_instance_of Hash
|
58
78
|
end
|
79
|
+
|
80
|
+
it 'returns a 404 if repo not found', :vcr do
|
81
|
+
expect { GitHub.languages('test','7ce4519eb32aa18d0917b0d407b53064') }.to raise_error GitHub::NotFound
|
82
|
+
end
|
59
83
|
end
|
60
84
|
|
61
85
|
# describe '.teams', :vcr do
|
@@ -68,6 +92,10 @@ describe GitHub::Client::Repos do
|
|
68
92
|
it 'returns an array of tags' do
|
69
93
|
GitHub.tags('rails','rails').should be_instance_of Array
|
70
94
|
end
|
95
|
+
|
96
|
+
it 'returns a 404 if repo not found', :vcr do
|
97
|
+
expect { GitHub.tags('test','7ce4519eb32aa18d0917b0d407b53064') }.to raise_error GitHub::NotFound
|
98
|
+
end
|
71
99
|
end
|
72
100
|
|
73
101
|
describe '.branches', :vcr do
|
@@ -80,12 +108,20 @@ describe GitHub::Client::Repos do
|
|
80
108
|
it 'returns a hash of branch info' do
|
81
109
|
GitHub.branch('rails','rails','master').should be_instance_of Hash
|
82
110
|
end
|
111
|
+
|
112
|
+
it 'returns a 404 if repo not found', :vcr do
|
113
|
+
expect { GitHub.branch('test','7ce4519eb32aa18d0917b0d407b53064','test') }.to raise_error GitHub::NotFound
|
114
|
+
end
|
83
115
|
end
|
84
116
|
|
85
117
|
describe '.collaborators', :vcr do
|
86
118
|
it 'returns a list of collaborators' do
|
87
119
|
GitHub.collaborators('caseyscarborough','github').should be_instance_of Array
|
88
120
|
end
|
121
|
+
|
122
|
+
it 'returns a 404 if repo not found', :vcr do
|
123
|
+
expect { GitHub.collaborators('test', '7ce4519eb32aa18d0917b0d407b53064') }.to raise_error GitHub::NotFound
|
124
|
+
end
|
89
125
|
end
|
90
126
|
|
91
127
|
describe '.collaborator?', :vcr do
|
@@ -4,11 +4,15 @@ describe GitHub::Client::Users do
|
|
4
4
|
|
5
5
|
describe '.user', :vcr do
|
6
6
|
it 'returns a hash' do
|
7
|
-
|
7
|
+
GitHub.user('caseyscarborough').should be_instance_of Hash
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'gets the correct user info', :vcr do
|
11
|
-
|
11
|
+
GitHub.user('caseyscarborough')['login'].should eq('caseyscarborough')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'returns a 404 if user not found' do
|
15
|
+
expect { GitHub.user('098f6bcd4621d373cade4e832627b4f6') }.to raise_error GitHub::NotFound
|
12
16
|
end
|
13
17
|
end
|
14
18
|
|
@@ -36,9 +40,12 @@ describe GitHub::Client::Users do
|
|
36
40
|
end
|
37
41
|
|
38
42
|
describe '.follows?', :vcr do
|
39
|
-
it 'returns
|
40
|
-
|
41
|
-
|
43
|
+
it 'returns true when following' do
|
44
|
+
GitHub.follows?('caseyscarborough','matz').should be_true
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'returns false when not following' do
|
48
|
+
GitHub.follows?('caseyscarborough','caseyscarborough').should be_false
|
42
49
|
end
|
43
50
|
end
|
44
51
|
|
@@ -80,12 +87,20 @@ describe GitHub::Client::Users do
|
|
80
87
|
it 'returns an array of keys for authenticated user' do
|
81
88
|
test_client.keys.should be_instance_of Array
|
82
89
|
end
|
90
|
+
|
91
|
+
it 'returns 404 for user not found' do
|
92
|
+
expect { GitHub.keys('098f6bcd4621d373cade4e832627b4f6') }.to raise_error GitHub::NotFound
|
93
|
+
end
|
83
94
|
end
|
84
95
|
|
85
96
|
describe '.events', :vcr do
|
86
97
|
it 'returns an array of events' do
|
87
98
|
GitHub.events('caseyscarborough').should be_instance_of Array
|
88
99
|
end
|
100
|
+
|
101
|
+
it 'returns a 404 for user not found' do
|
102
|
+
expect { GitHub.events('098f6bcd4621d373cade4e832627b4f6') }.to raise_error GitHub::NotFound
|
103
|
+
end
|
89
104
|
end
|
90
105
|
|
91
106
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_api_v3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Casey Scarborough
|
@@ -111,6 +111,8 @@ files:
|
|
111
111
|
- lib/github_api_v3.rb
|
112
112
|
- lib/github_api_v3/client.rb
|
113
113
|
- lib/github_api_v3/client/gists.rb
|
114
|
+
- lib/github_api_v3/client/gitignore.rb
|
115
|
+
- lib/github_api_v3/client/markdown.rb
|
114
116
|
- lib/github_api_v3/client/repos.rb
|
115
117
|
- lib/github_api_v3/client/users.rb
|
116
118
|
- lib/github_api_v3/default.rb
|
@@ -118,49 +120,85 @@ files:
|
|
118
120
|
- lib/github_api_v3/version.rb
|
119
121
|
- spec/cassettes/GitHub_Client_Gists/_create_delete_gist/creates_a_gist.json
|
120
122
|
- spec/cassettes/GitHub_Client_Gists/_create_delete_gist/deletes_a_gist.json
|
123
|
+
- spec/cassettes/GitHub_Client_Gists/_create_gist_comment/creates_the_comment.json
|
124
|
+
- spec/cassettes/GitHub_Client_Gists/_create_gist_comment/returns_comment_information_after_creation.json
|
125
|
+
- spec/cassettes/GitHub_Client_Gists/_delete_gist_comment/deletes_the_comment.json
|
126
|
+
- spec/cassettes/GitHub_Client_Gists/_delete_gist_comment/returns_true_or_false.json
|
127
|
+
- spec/cassettes/GitHub_Client_Gists/_edit_gist_comment/edits_the_comment.json
|
128
|
+
- spec/cassettes/GitHub_Client_Gists/_edit_gist_comment/returns_comment_information_after_editing.json
|
121
129
|
- spec/cassettes/GitHub_Client_Gists/_fork_gist/forks_a_gist.json
|
130
|
+
- spec/cassettes/GitHub_Client_Gists/_fork_gist/returns_false_when_not_found.json
|
131
|
+
- spec/cassettes/GitHub_Client_Gists/_gist/returns_a_404_when_not_found.json
|
122
132
|
- spec/cassettes/GitHub_Client_Gists/_gist/returns_gist_information.json
|
133
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comment/returns_a_404_when_not_found.json
|
134
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comment/returns_a_comment.json
|
135
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comments/returns_a_404_when_not_found.json
|
136
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comments/returns_a_list_of_comments.json
|
137
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_starred_/returns_false_when_not_found.json
|
123
138
|
- spec/cassettes/GitHub_Client_Gists/_gist_starred_/should_return_true_or_false.json
|
124
139
|
- spec/cassettes/GitHub_Client_Gists/_gists/returns_an_array_of_gists.json
|
125
140
|
- spec/cassettes/GitHub_Client_Gists/_gists/returns_an_array_of_gists_for_authenticated_user.json
|
126
141
|
- spec/cassettes/GitHub_Client_Gists/_gists/returns_public_gists_for_unauthenticated_user.json
|
142
|
+
- spec/cassettes/GitHub_Client_Gists/_star_gist/returns_false_when_not_found.json
|
127
143
|
- spec/cassettes/GitHub_Client_Gists/_star_gist/stars_a_gist.json
|
144
|
+
- spec/cassettes/GitHub_Client_Gists/_unstar_gist/returns_false_when_not_found.json
|
128
145
|
- spec/cassettes/GitHub_Client_Gists/_unstar_gist/unstars_a_gist.json
|
146
|
+
- spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_a_hash.json
|
147
|
+
- spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_the_correct_template.json
|
148
|
+
- spec/cassettes/GitHub_Client_Gitignore/_gitignore_list/returns_an_array_of_templates.json
|
149
|
+
- spec/cassettes/GitHub_Client_Markdown/_markdown/returns_rendered_markdown.json
|
129
150
|
- spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/adds_a_collaborator.json
|
130
151
|
- spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/removes_a_collaborator.json
|
131
152
|
- spec/cassettes/GitHub_Client_Repos/_all_repos/returns_an_array_of_repositories.json
|
153
|
+
- spec/cassettes/GitHub_Client_Repos/_branch/returns_a_404_if_repo_not_found.json
|
132
154
|
- spec/cassettes/GitHub_Client_Repos/_branch/returns_a_hash_of_branch_info.json
|
133
155
|
- spec/cassettes/GitHub_Client_Repos/_branches/returns_an_array_of_branches.json
|
134
156
|
- spec/cassettes/GitHub_Client_Repos/_collaborator_/returns_a_boolean.json
|
157
|
+
- spec/cassettes/GitHub_Client_Repos/_collaborators/returns_a_404_if_repo_not_found.json
|
135
158
|
- spec/cassettes/GitHub_Client_Repos/_collaborators/returns_a_list_of_collaborators.json
|
159
|
+
- spec/cassettes/GitHub_Client_Repos/_contributors/returns_a_404_if_repo_not_found.json
|
136
160
|
- spec/cassettes/GitHub_Client_Repos/_contributors/returns_an_array_of_contributors.json
|
137
161
|
- spec/cassettes/GitHub_Client_Repos/_create_repo/creates_the_repo.json
|
138
162
|
- spec/cassettes/GitHub_Client_Repos/_create_repo/returns_a_hash.json
|
163
|
+
- spec/cassettes/GitHub_Client_Repos/_create_repo/returns_unauthorized_when_not_authorized.json
|
139
164
|
- spec/cassettes/GitHub_Client_Repos/_delete_repo/deletes_a_repo.json
|
165
|
+
- spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_false_if_not_authorized.json
|
166
|
+
- spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_false_when_not_found.json
|
167
|
+
- spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_unauthorized_if_not_authorized.json
|
168
|
+
- spec/cassettes/GitHub_Client_Repos/_languages/returns_a_404_if_repo_not_found.json
|
140
169
|
- spec/cassettes/GitHub_Client_Repos/_languages/returns_a_hash_of_languages.json
|
141
170
|
- spec/cassettes/GitHub_Client_Repos/_languages/returns_an_array_of_languages.json
|
171
|
+
- spec/cassettes/GitHub_Client_Repos/_org_repos/returns_a_404_if_not_found.json
|
172
|
+
- spec/cassettes/GitHub_Client_Repos/_org_repos/returns_a_404_if_repo_not_found.json
|
142
173
|
- spec/cassettes/GitHub_Client_Repos/_org_repos/returns_an_array_of_repos.json
|
143
174
|
- spec/cassettes/GitHub_Client_Repos/_repo/returns_a_repo_as_a_hash.json
|
144
175
|
- spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories.json
|
145
176
|
- spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories_for_authenticated_user.json
|
177
|
+
- spec/cassettes/GitHub_Client_Repos/_tags/returns_a_404_if_repo_not_found.json
|
146
178
|
- spec/cassettes/GitHub_Client_Repos/_tags/returns_an_array_of_tags.json
|
147
179
|
- spec/cassettes/GitHub_Client_Users/_emails/returns_an_array_of_emails.json
|
180
|
+
- spec/cassettes/GitHub_Client_Users/_events/returns_a_404_for_user_not_found.json
|
148
181
|
- spec/cassettes/GitHub_Client_Users/_events/returns_an_array_of_events.json
|
149
182
|
- spec/cassettes/GitHub_Client_Users/_follow/follows_a_user.json
|
150
183
|
- spec/cassettes/GitHub_Client_Users/_followers/returns_authenticated_users_followers_as_an_array.json
|
151
184
|
- spec/cassettes/GitHub_Client_Users/_followers/returns_unauthenticated_users_followers_as_an_array.json
|
152
185
|
- spec/cassettes/GitHub_Client_Users/_following/returns_an_array_of_followees.json
|
153
186
|
- spec/cassettes/GitHub_Client_Users/_following_/returns_true_or_false.json
|
154
|
-
- spec/cassettes/GitHub_Client_Users/_follows_/
|
187
|
+
- spec/cassettes/GitHub_Client_Users/_follows_/returns_false_when_not_following.json
|
188
|
+
- spec/cassettes/GitHub_Client_Users/_follows_/returns_true_when_following.json
|
155
189
|
- spec/cassettes/GitHub_Client_Users/_unfollow/unfollows_a_user.json
|
156
190
|
- spec/cassettes/GitHub_Client_Users/_user/gets_the_correct_user_info.json
|
191
|
+
- spec/cassettes/GitHub_Client_Users/_user/returns_a_404_if_user_not_found.json
|
157
192
|
- spec/cassettes/GitHub_Client_Users/_user/returns_a_hash.json
|
158
193
|
- spec/cassettes/GitHub_Client_Users/_users/returns_an_array.json
|
159
194
|
- spec/cassettes/GitHub_Client_Users/_users/returns_an_array_of_hashes.json
|
195
|
+
- spec/cassettes/GitHub_Client_Users/keys/returns_404_for_user_not_found.json
|
160
196
|
- spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys.json
|
161
197
|
- spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys_for_authenticated_user.json
|
162
198
|
- spec/config.sample.yml
|
163
199
|
- spec/github_api_v3/client/gists_spec.rb
|
200
|
+
- spec/github_api_v3/client/gitignore_spec.rb
|
201
|
+
- spec/github_api_v3/client/markdown_spec.rb
|
164
202
|
- spec/github_api_v3/client/repos_spec.rb
|
165
203
|
- spec/github_api_v3/client/users_spec.rb
|
166
204
|
- spec/github_api_v3/client_spec.rb
|
@@ -192,49 +230,85 @@ summary: This gem is a wrapper that allows simple interaction with GitHub's API
|
|
192
230
|
test_files:
|
193
231
|
- spec/cassettes/GitHub_Client_Gists/_create_delete_gist/creates_a_gist.json
|
194
232
|
- spec/cassettes/GitHub_Client_Gists/_create_delete_gist/deletes_a_gist.json
|
233
|
+
- spec/cassettes/GitHub_Client_Gists/_create_gist_comment/creates_the_comment.json
|
234
|
+
- spec/cassettes/GitHub_Client_Gists/_create_gist_comment/returns_comment_information_after_creation.json
|
235
|
+
- spec/cassettes/GitHub_Client_Gists/_delete_gist_comment/deletes_the_comment.json
|
236
|
+
- spec/cassettes/GitHub_Client_Gists/_delete_gist_comment/returns_true_or_false.json
|
237
|
+
- spec/cassettes/GitHub_Client_Gists/_edit_gist_comment/edits_the_comment.json
|
238
|
+
- spec/cassettes/GitHub_Client_Gists/_edit_gist_comment/returns_comment_information_after_editing.json
|
195
239
|
- spec/cassettes/GitHub_Client_Gists/_fork_gist/forks_a_gist.json
|
240
|
+
- spec/cassettes/GitHub_Client_Gists/_fork_gist/returns_false_when_not_found.json
|
241
|
+
- spec/cassettes/GitHub_Client_Gists/_gist/returns_a_404_when_not_found.json
|
196
242
|
- spec/cassettes/GitHub_Client_Gists/_gist/returns_gist_information.json
|
243
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comment/returns_a_404_when_not_found.json
|
244
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comment/returns_a_comment.json
|
245
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comments/returns_a_404_when_not_found.json
|
246
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_comments/returns_a_list_of_comments.json
|
247
|
+
- spec/cassettes/GitHub_Client_Gists/_gist_starred_/returns_false_when_not_found.json
|
197
248
|
- spec/cassettes/GitHub_Client_Gists/_gist_starred_/should_return_true_or_false.json
|
198
249
|
- spec/cassettes/GitHub_Client_Gists/_gists/returns_an_array_of_gists.json
|
199
250
|
- spec/cassettes/GitHub_Client_Gists/_gists/returns_an_array_of_gists_for_authenticated_user.json
|
200
251
|
- spec/cassettes/GitHub_Client_Gists/_gists/returns_public_gists_for_unauthenticated_user.json
|
252
|
+
- spec/cassettes/GitHub_Client_Gists/_star_gist/returns_false_when_not_found.json
|
201
253
|
- spec/cassettes/GitHub_Client_Gists/_star_gist/stars_a_gist.json
|
254
|
+
- spec/cassettes/GitHub_Client_Gists/_unstar_gist/returns_false_when_not_found.json
|
202
255
|
- spec/cassettes/GitHub_Client_Gists/_unstar_gist/unstars_a_gist.json
|
256
|
+
- spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_a_hash.json
|
257
|
+
- spec/cassettes/GitHub_Client_Gitignore/_gitignore/returns_the_correct_template.json
|
258
|
+
- spec/cassettes/GitHub_Client_Gitignore/_gitignore_list/returns_an_array_of_templates.json
|
259
|
+
- spec/cassettes/GitHub_Client_Markdown/_markdown/returns_rendered_markdown.json
|
203
260
|
- spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/adds_a_collaborator.json
|
204
261
|
- spec/cassettes/GitHub_Client_Repos/_add_remove_collaborator/removes_a_collaborator.json
|
205
262
|
- spec/cassettes/GitHub_Client_Repos/_all_repos/returns_an_array_of_repositories.json
|
263
|
+
- spec/cassettes/GitHub_Client_Repos/_branch/returns_a_404_if_repo_not_found.json
|
206
264
|
- spec/cassettes/GitHub_Client_Repos/_branch/returns_a_hash_of_branch_info.json
|
207
265
|
- spec/cassettes/GitHub_Client_Repos/_branches/returns_an_array_of_branches.json
|
208
266
|
- spec/cassettes/GitHub_Client_Repos/_collaborator_/returns_a_boolean.json
|
267
|
+
- spec/cassettes/GitHub_Client_Repos/_collaborators/returns_a_404_if_repo_not_found.json
|
209
268
|
- spec/cassettes/GitHub_Client_Repos/_collaborators/returns_a_list_of_collaborators.json
|
269
|
+
- spec/cassettes/GitHub_Client_Repos/_contributors/returns_a_404_if_repo_not_found.json
|
210
270
|
- spec/cassettes/GitHub_Client_Repos/_contributors/returns_an_array_of_contributors.json
|
211
271
|
- spec/cassettes/GitHub_Client_Repos/_create_repo/creates_the_repo.json
|
212
272
|
- spec/cassettes/GitHub_Client_Repos/_create_repo/returns_a_hash.json
|
273
|
+
- spec/cassettes/GitHub_Client_Repos/_create_repo/returns_unauthorized_when_not_authorized.json
|
213
274
|
- spec/cassettes/GitHub_Client_Repos/_delete_repo/deletes_a_repo.json
|
275
|
+
- spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_false_if_not_authorized.json
|
276
|
+
- spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_false_when_not_found.json
|
277
|
+
- spec/cassettes/GitHub_Client_Repos/_delete_repo/returns_unauthorized_if_not_authorized.json
|
278
|
+
- spec/cassettes/GitHub_Client_Repos/_languages/returns_a_404_if_repo_not_found.json
|
214
279
|
- spec/cassettes/GitHub_Client_Repos/_languages/returns_a_hash_of_languages.json
|
215
280
|
- spec/cassettes/GitHub_Client_Repos/_languages/returns_an_array_of_languages.json
|
281
|
+
- spec/cassettes/GitHub_Client_Repos/_org_repos/returns_a_404_if_not_found.json
|
282
|
+
- spec/cassettes/GitHub_Client_Repos/_org_repos/returns_a_404_if_repo_not_found.json
|
216
283
|
- spec/cassettes/GitHub_Client_Repos/_org_repos/returns_an_array_of_repos.json
|
217
284
|
- spec/cassettes/GitHub_Client_Repos/_repo/returns_a_repo_as_a_hash.json
|
218
285
|
- spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories.json
|
219
286
|
- spec/cassettes/GitHub_Client_Repos/_repos/returns_an_array_of_repositories_for_authenticated_user.json
|
287
|
+
- spec/cassettes/GitHub_Client_Repos/_tags/returns_a_404_if_repo_not_found.json
|
220
288
|
- spec/cassettes/GitHub_Client_Repos/_tags/returns_an_array_of_tags.json
|
221
289
|
- spec/cassettes/GitHub_Client_Users/_emails/returns_an_array_of_emails.json
|
290
|
+
- spec/cassettes/GitHub_Client_Users/_events/returns_a_404_for_user_not_found.json
|
222
291
|
- spec/cassettes/GitHub_Client_Users/_events/returns_an_array_of_events.json
|
223
292
|
- spec/cassettes/GitHub_Client_Users/_follow/follows_a_user.json
|
224
293
|
- spec/cassettes/GitHub_Client_Users/_followers/returns_authenticated_users_followers_as_an_array.json
|
225
294
|
- spec/cassettes/GitHub_Client_Users/_followers/returns_unauthenticated_users_followers_as_an_array.json
|
226
295
|
- spec/cassettes/GitHub_Client_Users/_following/returns_an_array_of_followees.json
|
227
296
|
- spec/cassettes/GitHub_Client_Users/_following_/returns_true_or_false.json
|
228
|
-
- spec/cassettes/GitHub_Client_Users/_follows_/
|
297
|
+
- spec/cassettes/GitHub_Client_Users/_follows_/returns_false_when_not_following.json
|
298
|
+
- spec/cassettes/GitHub_Client_Users/_follows_/returns_true_when_following.json
|
229
299
|
- spec/cassettes/GitHub_Client_Users/_unfollow/unfollows_a_user.json
|
230
300
|
- spec/cassettes/GitHub_Client_Users/_user/gets_the_correct_user_info.json
|
301
|
+
- spec/cassettes/GitHub_Client_Users/_user/returns_a_404_if_user_not_found.json
|
231
302
|
- spec/cassettes/GitHub_Client_Users/_user/returns_a_hash.json
|
232
303
|
- spec/cassettes/GitHub_Client_Users/_users/returns_an_array.json
|
233
304
|
- spec/cassettes/GitHub_Client_Users/_users/returns_an_array_of_hashes.json
|
305
|
+
- spec/cassettes/GitHub_Client_Users/keys/returns_404_for_user_not_found.json
|
234
306
|
- spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys.json
|
235
307
|
- spec/cassettes/GitHub_Client_Users/keys/returns_an_array_of_keys_for_authenticated_user.json
|
236
308
|
- spec/config.sample.yml
|
237
309
|
- spec/github_api_v3/client/gists_spec.rb
|
310
|
+
- spec/github_api_v3/client/gitignore_spec.rb
|
311
|
+
- spec/github_api_v3/client/markdown_spec.rb
|
238
312
|
- spec/github_api_v3/client/repos_spec.rb
|
239
313
|
- spec/github_api_v3/client/users_spec.rb
|
240
314
|
- spec/github_api_v3/client_spec.rb
|