rubygems-code_finder 0.0.2 → 0.0.3
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/CHANGELOG.md +5 -0
- data/README.md +3 -7
- data/lib/rubygems/code_finder/version.rb +1 -1
- data/lib/rubygems-code_finder.rb +4 -0
- data/rubygems-code_finder.gemspec +1 -0
- data/spec/fixtures/repositories?q=fluentd +2645 -0
- data/spec/fixtures/repositories?q=reposnotfound +6 -0
- data/spec/rubygems/code_finder/url_spec.rb +11 -0
- metadata +19 -1
@@ -22,9 +22,20 @@ describe Rubygems::CodeFinder do
|
|
22
22
|
expect(Rubygems::CodeFinder.url('mm-devise')).to eq 'http://github.com/kristianmandrup/mm-devise'
|
23
23
|
end
|
24
24
|
|
25
|
+
it 'returns github search response' do
|
26
|
+
stub_request(:get, 'https://rubygems.org/api/v1/gems/fluentd.json').
|
27
|
+
to_return(status: 200, body: File.new('./spec/fixtures/fluentd.json'), headers: {})
|
28
|
+
stub_request(:get, 'https://api.github.com/search/repositories?q=fluentd').
|
29
|
+
to_return(status: 200, body: File.new('./spec/fixtures/repositories?q=fluentd'), headers: { content_type: 'application/json; charset=utf-8'})
|
30
|
+
|
31
|
+
expect(Rubygems::CodeFinder.url('fluentd')).to eq 'https://github.com/fluent/fluentd'
|
32
|
+
end
|
33
|
+
|
25
34
|
it 'fails repository not found' do
|
26
35
|
stub_request(:get, 'https://rubygems.org/api/v1/gems/fluentd.json').
|
27
36
|
to_return(status: 200, body: File.new('./spec/fixtures/fluentd.json'), headers: {})
|
37
|
+
stub_request(:get, 'https://api.github.com/search/repositories?q=fluentd').
|
38
|
+
to_return(status: 200, body: File.new('./spec/fixtures/repositories?q=reposnotfound'), headers: { content_type: 'application/json; charset=utf-8'})
|
28
39
|
|
29
40
|
expect { Rubygems::CodeFinder.url('fluentd') }.to raise_error(Rubygems::CodeFinder::RepositoryNotFound)
|
30
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-code_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: octokit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,6 +128,8 @@ files:
|
|
114
128
|
- rubygems-code_finder.gemspec
|
115
129
|
- spec/fixtures/fluentd.json
|
116
130
|
- spec/fixtures/mm-devise.json
|
131
|
+
- spec/fixtures/repositories?q=fluentd
|
132
|
+
- spec/fixtures/repositories?q=reposnotfound
|
117
133
|
- spec/fixtures/tachikoma.json
|
118
134
|
- spec/rubygems/code_finder/url_spec.rb
|
119
135
|
- spec/spec_helper.rb
|
@@ -144,6 +160,8 @@ summary: Easy to find rubygems' github repository.
|
|
144
160
|
test_files:
|
145
161
|
- spec/fixtures/fluentd.json
|
146
162
|
- spec/fixtures/mm-devise.json
|
163
|
+
- spec/fixtures/repositories?q=fluentd
|
164
|
+
- spec/fixtures/repositories?q=reposnotfound
|
147
165
|
- spec/fixtures/tachikoma.json
|
148
166
|
- spec/rubygems/code_finder/url_spec.rb
|
149
167
|
- spec/spec_helper.rb
|