fanart_api 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -15
- data/.travis.yml +2 -1
- data/CHANGELOG.md +31 -0
- data/README.md +64 -31
- data/fanart_api.gemspec +5 -3
- data/lib/fanart_api.rb +2 -0
- data/lib/fanart_api/base.rb +4 -4
- data/lib/fanart_api/client.rb +7 -7
- data/lib/fanart_api/movie.rb +97 -5
- data/lib/fanart_api/music.rb +167 -9
- data/lib/fanart_api/tv.rb +95 -5
- data/lib/fanart_api/version.rb +1 -1
- data/spec/functionals/movie_spec.rb +71 -14
- data/spec/functionals/music_spec.rb +121 -24
- data/spec/functionals/tv_spec.rb +69 -12
- data/spec/integrations/movie_spec.rb +21 -9
- data/spec/integrations/music_spec.rb +39 -17
- data/spec/spec_helper.rb +2 -4
- data/spec/support/.keep +0 -0
- data/spec/support/api_key.rb.example +1 -0
- metadata +46 -13
@@ -1,18 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe FanartApi::Movie do
|
4
|
-
let(:
|
5
|
-
let(:model) {
|
4
|
+
let(:client) { FanartApi::Client.new(api_key: API_KEY) }
|
5
|
+
let(:model) { client.movie }
|
6
6
|
|
7
|
-
describe '
|
8
|
-
|
9
|
-
|
7
|
+
describe 'real request' do
|
8
|
+
describe '.find' do
|
9
|
+
it 'should return response class' do
|
10
|
+
response = model.find('tt0120737')
|
11
|
+
ap response.body
|
12
|
+
|
13
|
+
expect(response).to be_a(Faraday::Response)
|
14
|
+
expect(response.status).to eq(200)
|
15
|
+
expect(response.body).to be_a(Hash)
|
16
|
+
end
|
10
17
|
end
|
11
|
-
end
|
12
18
|
|
13
|
-
|
14
|
-
|
15
|
-
|
19
|
+
describe '.latest' do
|
20
|
+
it 'should return response class' do
|
21
|
+
response = model.latest
|
22
|
+
ap response.body
|
23
|
+
|
24
|
+
expect(response).to be_a(Faraday::Response)
|
25
|
+
expect(response.status).to eq(200)
|
26
|
+
expect(response.body).to be_a(Array)
|
27
|
+
end
|
16
28
|
end
|
17
29
|
end
|
18
30
|
end
|
@@ -1,30 +1,52 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe FanartApi::Music do
|
4
|
-
let(:
|
5
|
-
let(:model) {
|
4
|
+
let(:client) { FanartApi::Client.new(api_key: API_KEY) }
|
5
|
+
let(:model) { client.music }
|
6
6
|
|
7
|
-
describe '
|
8
|
-
|
9
|
-
|
7
|
+
describe 'real request' do
|
8
|
+
describe '.artist' do
|
9
|
+
it 'should return response class' do
|
10
|
+
response = model.artist('f4a31f0a-51dd-4fa7-986d-3095c40c5ed9')
|
11
|
+
ap response.body
|
12
|
+
|
13
|
+
expect(response).to be_a(Faraday::Response)
|
14
|
+
expect(response.status).to eq(200)
|
15
|
+
expect(response.body).to be_a(Hash)
|
16
|
+
end
|
10
17
|
end
|
11
|
-
end
|
12
18
|
|
13
|
-
|
14
|
-
|
15
|
-
|
19
|
+
describe '.album' do
|
20
|
+
it 'should return response class' do
|
21
|
+
response = model.album('9ba659df-5814-32f6-b95f-02b738698e7c')
|
22
|
+
ap response.body
|
23
|
+
|
24
|
+
expect(response).to be_a(Faraday::Response)
|
25
|
+
expect(response.status).to eq(200)
|
26
|
+
expect(response.body).to be_a(Hash)
|
27
|
+
end
|
16
28
|
end
|
17
|
-
end
|
18
29
|
|
19
|
-
|
20
|
-
|
21
|
-
|
30
|
+
describe '.label' do
|
31
|
+
it 'should return response class' do
|
32
|
+
response = model.label('e832b688-546b-45e3-83e5-9f8db5dcde1d')
|
33
|
+
ap response.body
|
34
|
+
|
35
|
+
expect(response).to be_a(Faraday::Response)
|
36
|
+
expect(response.status).to eq(200)
|
37
|
+
expect(response.body).to be_a(Hash)
|
38
|
+
end
|
22
39
|
end
|
23
|
-
end
|
24
40
|
|
25
|
-
|
26
|
-
|
27
|
-
|
41
|
+
describe '.latest' do
|
42
|
+
it 'should return response class' do
|
43
|
+
response = model.latest
|
44
|
+
ap response.body
|
45
|
+
|
46
|
+
expect(response).to be_a(Faraday::Response)
|
47
|
+
expect(response.status).to eq(200)
|
48
|
+
expect(response.body).to be_a(Array)
|
49
|
+
end
|
28
50
|
end
|
29
51
|
end
|
30
52
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/.keep
ADDED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
API_KEY = ''
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanart_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Wawer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: service_api
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ov
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0
|
33
|
+
version: 0.1.0
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- -
|
38
|
+
- - ~>
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0
|
40
|
+
version: 0.1.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,30 +70,44 @@ dependencies:
|
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - ~>
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 3.1.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - ~>
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 3.1.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: coveralls
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ~>
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0.7'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ~>
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0.7'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: awesome_print
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.6.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.6.0
|
83
111
|
description: Ruby client for fanart.tv API
|
84
112
|
email:
|
85
113
|
- krzysztof.wawer@gmail.com
|
@@ -89,6 +117,7 @@ extra_rdoc_files: []
|
|
89
117
|
files:
|
90
118
|
- .gitignore
|
91
119
|
- .travis.yml
|
120
|
+
- CHANGELOG.md
|
92
121
|
- Gemfile
|
93
122
|
- LICENSE.txt
|
94
123
|
- README.md
|
@@ -114,6 +143,8 @@ files:
|
|
114
143
|
- spec/integrations/music_spec.rb
|
115
144
|
- spec/integrations/tv_spec.rb
|
116
145
|
- spec/spec_helper.rb
|
146
|
+
- spec/support/.keep
|
147
|
+
- spec/support/api_key.rb.example
|
117
148
|
homepage: http://github.com/wafcio/fanart_api
|
118
149
|
licenses:
|
119
150
|
- MIT
|
@@ -134,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
165
|
version: '0'
|
135
166
|
requirements: []
|
136
167
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.4.5
|
138
169
|
signing_key:
|
139
170
|
specification_version: 4
|
140
171
|
summary: Ruby client for fanart.tv API
|
@@ -152,3 +183,5 @@ test_files:
|
|
152
183
|
- spec/integrations/music_spec.rb
|
153
184
|
- spec/integrations/tv_spec.rb
|
154
185
|
- spec/spec_helper.rb
|
186
|
+
- spec/support/.keep
|
187
|
+
- spec/support/api_key.rb.example
|