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.
@@ -1,18 +1,30 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe FanartApi::Movie do
4
- let(:klass) { FanartApi::Movie }
5
- let(:model) { klass.new(FanartApi::Client.new) }
4
+ let(:client) { FanartApi::Client.new(api_key: API_KEY) }
5
+ let(:model) { client.movie }
6
6
 
7
- describe '.find' do
8
- it 'should return response class' do
9
- model.find('tt0120737').class.should == HTTParty::Response
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
- describe '.update' do
14
- it 'should call get with specific uri' do
15
- model.update.class.should == HTTParty::Response
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(:klass) { FanartApi::Music }
5
- let(:model) { klass.new(FanartApi::Client.new) }
4
+ let(:client) { FanartApi::Client.new(api_key: API_KEY) }
5
+ let(:model) { client.music }
6
6
 
7
- describe '.artist' do
8
- it 'should return response class' do
9
- model.artist('f4a31f0a-51dd-4fa7-986d-3095c40c5ed9').class.should == HTTParty::Response
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
- describe '.album' do
14
- it 'should return response class' do
15
- model.album('f4a31f0a-51dd-4fa7-986d-3095c40c5ed9').class.should == HTTParty::Response
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
- describe '.label' do
20
- it 'should return response class' do
21
- model.label('f4a31f0a-51dd-4fa7-986d-3095c40c5ed9').class.should == HTTParty::Response
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
- describe '.update' do
26
- it 'should call get with specific uri' do
27
- model.update.class.should == HTTParty::Response
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
@@ -1,9 +1,7 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
1
  require 'coveralls'
4
2
  Coveralls.wear!
5
3
 
4
+ require 'awesome_print'
6
5
  require 'fanart_api'
7
6
 
8
- RSpec.configure do |config|
9
- end
7
+ Dir['spec/support/**/*.rb'].each { |f| require "./#{f}" }
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.2.1
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: 2014-09-03 00:00:00.000000000 Z
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.4
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.4
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: 2.14.1
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: 2.14.1
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.0.3
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