thetvdb_api 0.2.5 → 0.3.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -15
  3. data/CHANGELOG.md +53 -0
  4. data/README.md +80 -103
  5. data/lib/thetvdb_api/actor.rb +18 -11
  6. data/lib/thetvdb_api/banner.rb +18 -11
  7. data/lib/thetvdb_api/base.rb +24 -0
  8. data/lib/thetvdb_api/episode.rb +68 -48
  9. data/lib/thetvdb_api/search.rb +85 -28
  10. data/lib/thetvdb_api/series.rb +36 -22
  11. data/lib/thetvdb_api/update.rb +8 -4
  12. data/lib/thetvdb_api/version.rb +1 -1
  13. data/spec/functionals/actor_spec.rb +26 -6
  14. data/spec/functionals/banner_spec.rb +26 -6
  15. data/spec/functionals/base_spec.rb +79 -0
  16. data/spec/functionals/episode_spec.rb +120 -28
  17. data/spec/functionals/search_spec.rb +143 -25
  18. data/spec/functionals/series_spec.rb +54 -14
  19. data/spec/functionals/update_spec.rb +12 -12
  20. data/spec/integrations/actor_spec.rb +14 -0
  21. data/spec/integrations/banner_spec.rb +14 -0
  22. data/spec/integrations/client_spec.rb +150 -0
  23. data/spec/integrations/episode_spec.rb +43 -0
  24. data/spec/integrations/search_spec.rb +41 -0
  25. data/spec/integrations/series_spec.rb +23 -0
  26. data/spec/integrations/update_spec.rb +32 -0
  27. data/spec/spec_helper.rb +1 -4
  28. data/spec/support/.keep +0 -0
  29. data/spec/support/api_key.rb.example +1 -0
  30. data/thetvdb_api.gemspec +2 -2
  31. metadata +29 -24
  32. data/spec/integrations/classes/actor_spec.rb +0 -13
  33. data/spec/integrations/classes/banner_spec.rb +0 -13
  34. data/spec/integrations/classes/client_spec.rb +0 -109
  35. data/spec/integrations/classes/episode_spec.rb +0 -31
  36. data/spec/integrations/classes/search_spec.rb +0 -31
  37. data/spec/integrations/classes/series_spec.rb +0 -19
  38. data/spec/integrations/classes/update_spec.rb +0 -31
  39. data/spec/integrations/integration_spec_helper.rb +0 -2
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe ThetvdbApi::Update do
4
+ let(:model) { ThetvdbApi::Update.new(api_key: API_KEY) }
5
+
6
+ describe '.day' do
7
+ it 'should return response class' do
8
+ response = model.day
9
+ expect(response).to be_a(Faraday::Response)
10
+ expect(response.status).to eq(200)
11
+ expect(response.body).to be_a(Hash)
12
+ end
13
+ end
14
+
15
+ describe '.week' do
16
+ it 'should return response class' do
17
+ response = model.week
18
+ expect(response).to be_a(Faraday::Response)
19
+ expect(response.status).to eq(200)
20
+ expect(response.body).to be_a(Hash)
21
+ end
22
+ end
23
+
24
+ describe '.month' do
25
+ it 'should return response class' do
26
+ response = model.month
27
+ expect(response).to be_a(Faraday::Response)
28
+ expect(response.status).to eq(200)
29
+ expect(response.body).to be_a(Hash)
30
+ end
31
+ end
32
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,6 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
1
  require 'coveralls'
4
2
  Coveralls.wear!
5
3
 
6
4
  require 'thetvdb_api'
7
5
 
8
- RSpec.configure do |config|
9
- end
6
+ Dir['spec/support/**/*.rb'].each { |f| require "./#{f}" }
File without changes
@@ -0,0 +1 @@
1
+ API_KEY = ''
data/thetvdb_api.gemspec CHANGED
@@ -18,10 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_runtime_dependency 'service_api', '~> 0.0.5'
21
+ spec.add_runtime_dependency 'service_api', '0.0.9'
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.3'
24
24
  spec.add_development_dependency 'rake'
25
- spec.add_development_dependency 'rspec', '~> 2.14.1'
25
+ spec.add_development_dependency 'rspec', '~> 3.0.0'
26
26
  spec.add_development_dependency 'coveralls', '~> 0.7'
27
27
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thetvdb_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
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-08-31 00:00:00.000000000 Z
11
+ date: 2014-09-05 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
18
  - !ruby/object:Gem::Version
19
- version: 0.0.5
19
+ version: 0.0.9
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.5
26
+ version: 0.0.9
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 2.14.1
61
+ version: 3.0.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 2.14.1
68
+ version: 3.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: coveralls
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -89,6 +89,7 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - .gitignore
91
91
  - .travis.yml
92
+ - CHANGELOG.md
92
93
  - Gemfile
93
94
  - LICENSE.txt
94
95
  - README.md
@@ -114,19 +115,21 @@ files:
114
115
  - spec/fixtures/updates.xml
115
116
  - spec/functionals/actor_spec.rb
116
117
  - spec/functionals/banner_spec.rb
118
+ - spec/functionals/base_spec.rb
117
119
  - spec/functionals/episode_spec.rb
118
120
  - spec/functionals/search_spec.rb
119
121
  - spec/functionals/series_spec.rb
120
122
  - spec/functionals/update_spec.rb
121
- - spec/integrations/classes/actor_spec.rb
122
- - spec/integrations/classes/banner_spec.rb
123
- - spec/integrations/classes/client_spec.rb
124
- - spec/integrations/classes/episode_spec.rb
125
- - spec/integrations/classes/search_spec.rb
126
- - spec/integrations/classes/series_spec.rb
127
- - spec/integrations/classes/update_spec.rb
128
- - spec/integrations/integration_spec_helper.rb
123
+ - spec/integrations/actor_spec.rb
124
+ - spec/integrations/banner_spec.rb
125
+ - spec/integrations/client_spec.rb
126
+ - spec/integrations/episode_spec.rb
127
+ - spec/integrations/search_spec.rb
128
+ - spec/integrations/series_spec.rb
129
+ - spec/integrations/update_spec.rb
129
130
  - spec/spec_helper.rb
131
+ - spec/support/.keep
132
+ - spec/support/api_key.rb.example
130
133
  - thetvdb_api.gemspec
131
134
  homepage: http://github.com/wafcio/thetvdb_api
132
135
  licenses:
@@ -164,16 +167,18 @@ test_files:
164
167
  - spec/fixtures/updates.xml
165
168
  - spec/functionals/actor_spec.rb
166
169
  - spec/functionals/banner_spec.rb
170
+ - spec/functionals/base_spec.rb
167
171
  - spec/functionals/episode_spec.rb
168
172
  - spec/functionals/search_spec.rb
169
173
  - spec/functionals/series_spec.rb
170
174
  - spec/functionals/update_spec.rb
171
- - spec/integrations/classes/actor_spec.rb
172
- - spec/integrations/classes/banner_spec.rb
173
- - spec/integrations/classes/client_spec.rb
174
- - spec/integrations/classes/episode_spec.rb
175
- - spec/integrations/classes/search_spec.rb
176
- - spec/integrations/classes/series_spec.rb
177
- - spec/integrations/classes/update_spec.rb
178
- - spec/integrations/integration_spec_helper.rb
175
+ - spec/integrations/actor_spec.rb
176
+ - spec/integrations/banner_spec.rb
177
+ - spec/integrations/client_spec.rb
178
+ - spec/integrations/episode_spec.rb
179
+ - spec/integrations/search_spec.rb
180
+ - spec/integrations/series_spec.rb
181
+ - spec/integrations/update_spec.rb
179
182
  - spec/spec_helper.rb
183
+ - spec/support/.keep
184
+ - spec/support/api_key.rb.example
@@ -1,13 +0,0 @@
1
- require 'integrations/integration_spec_helper'
2
-
3
- describe ThetvdbApi::Actor do
4
- let(:model) { ThetvdbApi::Actor.new(ThetvdbApi::Client.new) }
5
-
6
- describe 'real request' do
7
- describe '.find' do
8
- it 'should return response class' do
9
- model.find('70327').class.should == ThetvdbApi::Response::Actors
10
- end
11
- end
12
- end
13
- end
@@ -1,13 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbApi::Banner do
4
- let(:model) { ThetvdbApi::Banner.new(ThetvdbApi::Client.new) }
5
-
6
- describe 'real request' do
7
- describe '.find' do
8
- it 'should return response class' do
9
- model.find('72449').class.should == ThetvdbApi::Response::Banners
10
- end
11
- end
12
- end
13
- end
@@ -1,109 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbApi::Client do
4
- let(:client) { ThetvdbApi::Client.new }
5
-
6
- describe 'real request' do
7
- describe '.search' do
8
- describe '.get_series' do
9
- it 'should return response class' do
10
- client.search.get_series('buffy').class.should == ThetvdbApi::Response::SearchMultipleSeries
11
- end
12
- end
13
-
14
- describe '.get_series_by_imdb_id' do
15
- it 'should return response class' do
16
- client.search.get_series_by_imdb_id('tt0118276').class.should == ThetvdbApi::Response::SearchSeries
17
- end
18
- end
19
-
20
- describe '.get_series_by_zap2it_id' do
21
- it 'should return response class' do
22
- client.search.get_series_by_zap2it_id('EP00213110').class.should == ThetvdbApi::Response::SearchSeries
23
- end
24
- end
25
-
26
- describe '.get_episode' do
27
- it 'should return response class' do
28
- client.search.get_episode('70327','1997-03-10').class.should == ThetvdbApi::Response::SearchMultipleEpisode
29
- end
30
- end
31
- end
32
-
33
- describe '.series' do
34
- describe '.find' do
35
- it 'should return response class' do
36
- client.series.find('70327').class.should == ThetvdbApi::Response::Series
37
- end
38
- end
39
-
40
- describe '.find_full' do
41
- it 'should return response class' do
42
- client.series.find_full('70327').class.should == ThetvdbApi::Response::FullSeries
43
- end
44
- end
45
- end
46
-
47
- describe '.actor' do
48
- describe '.find' do
49
- it 'should return response class' do
50
- client.actor.find('70327').class.should == ThetvdbApi::Response::Actors
51
- end
52
- end
53
- end
54
-
55
- describe '.banner' do
56
- describe '.find' do
57
- it 'should return response class' do
58
- client.banner.find('70327').class.should == ThetvdbApi::Response::Banners
59
- end
60
- end
61
- end
62
-
63
- describe '.episode' do
64
- describe '.find_by_default_order' do
65
- it 'should return response class' do
66
- client.episode.find_by_default_order('70327', '1', '1').class.should == ThetvdbApi::Response::Episode
67
- end
68
- end
69
-
70
- describe '.find_by_dvd_order' do
71
- it 'should return response class' do
72
- client.episode.find_by_dvd_order('70327', '1', '1').class.should == ThetvdbApi::Response::Episode
73
- end
74
- end
75
-
76
- describe '.find_by_absolute_order' do
77
- it 'should return response class' do
78
- client.episode.find_by_absolute_order('70327', '1').class.should == ThetvdbApi::Response::Episode
79
- end
80
- end
81
-
82
- describe '.find' do
83
- it 'should return response class' do
84
- client.episode.find('533011').class.should == ThetvdbApi::Response::Episode
85
- end
86
- end
87
- end
88
-
89
- describe '.update' do
90
- describe '.day' do
91
- it 'should return response class' do
92
- client.update.day.class.should == ThetvdbApi::Response::Update
93
- end
94
- end
95
-
96
- describe '.week' do
97
- it 'should return response class' do
98
- client.update.week.class.should == ThetvdbApi::Response::Update
99
- end
100
- end
101
-
102
- describe '.month' do
103
- it 'should return response class' do
104
- client.update.month.class.should == ThetvdbApi::Response::Update
105
- end
106
- end
107
- end
108
- end
109
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbApi::Episode do
4
- let(:model) { ThetvdbApi::Episode.new(ThetvdbApi::Client.new) }
5
-
6
- describe 'real request' do
7
- describe '.find_by_default_order' do
8
- it 'should return response class' do
9
- model.find_by_default_order('70327', '1', '1').class.should == ThetvdbApi::Response::Episode
10
- end
11
- end
12
-
13
- describe '.find_by_dvd_order' do
14
- it 'should return response class' do
15
- model.find_by_dvd_order('70327', '1', '1').class.should == ThetvdbApi::Response::Episode
16
- end
17
- end
18
-
19
- describe '.find_by_absolute_order' do
20
- it 'should return response class' do
21
- model.find_by_absolute_order('70327', '1').class.should == ThetvdbApi::Response::Episode
22
- end
23
- end
24
-
25
- describe '.find' do
26
- it 'should return response class' do
27
- model.find('533011').class.should == ThetvdbApi::Response::Episode
28
- end
29
- end
30
- end
31
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbApi::Search do
4
- let(:model) { ThetvdbApi::Search.new(ThetvdbApi::Client.new) }
5
-
6
- describe 'real request' do
7
- describe '.get_series' do
8
- it 'should return response class' do
9
- model.get_series('buffy').class.should == ThetvdbApi::Response::SearchMultipleSeries
10
- end
11
- end
12
-
13
- describe '.get_series_by_imdb_id' do
14
- it 'should return response class' do
15
- model.get_series_by_imdb_id('tt0118276').class.should == ThetvdbApi::Response::SearchSeries
16
- end
17
- end
18
-
19
- describe '.get_series_by_zap2it_id' do
20
- it 'should return response class' do
21
- model.get_series_by_zap2it_id('EP00213110').class.should == ThetvdbApi::Response::SearchSeries
22
- end
23
- end
24
-
25
- describe '.get_episode' do
26
- it 'should return response class' do
27
- model.get_episode('70327', '1997-03-10').class.should == ThetvdbApi::Response::SearchMultipleEpisode
28
- end
29
- end
30
- end
31
- end
@@ -1,19 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbApi::Series do
4
- let(:model) { ThetvdbApi::Series.new(ThetvdbApi::Client.new) }
5
-
6
- describe 'real request' do
7
- describe '.find' do
8
- it 'should return response class' do
9
- model.find('70327').class.should == ThetvdbApi::Response::Series
10
- end
11
- end
12
-
13
- describe '.find_full' do
14
- it 'should return response class' do
15
- model.find_full('70327').class.should == ThetvdbApi::Response::FullSeries
16
- end
17
- end
18
- end
19
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbApi::Update do
4
- let(:model) { ThetvdbApi::Update.new(ThetvdbApi::Client.new) }
5
-
6
- describe 'real request' do
7
- describe '.day' do
8
- it 'should return response class' do
9
- model.day.class.should == ThetvdbApi::Response::Update
10
- end
11
- end
12
-
13
- describe '.week' do
14
- it 'should return response class' do
15
- model.week.class.should == ThetvdbApi::Response::Update
16
- end
17
- end
18
-
19
- describe '.month' do
20
- it 'should return response class' do
21
- model.month.class.should == ThetvdbApi::Response::Update
22
- end
23
- end
24
-
25
- describe '.all' do
26
- it 'should return response class' do
27
- model.all.class.should == ThetvdbApi::Response::Update
28
- end
29
- end
30
- end
31
- end
@@ -1,2 +0,0 @@
1
- require 'spec_helper'
2
- require 'integrations/support/configuration'