thetvdb_api 0.2.3.1 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +30 -51
- data/lib/thetvdb_api/actor.rb +9 -9
- data/lib/thetvdb_api/banner.rb +9 -9
- data/lib/thetvdb_api/base.rb +10 -56
- data/lib/thetvdb_api/client.rb +6 -4
- data/lib/thetvdb_api/episode.rb +33 -34
- data/lib/thetvdb_api/search.rb +23 -35
- data/lib/thetvdb_api/series.rb +17 -17
- data/lib/thetvdb_api/update.rb +32 -32
- data/lib/thetvdb_api/version.rb +1 -1
- data/lib/thetvdb_api.rb +0 -12
- data/spec/fixtures/get_episode.xml +30 -0
- data/spec/fixtures/get_series.xml +24 -0
- data/spec/fixtures/get_series_by_remote.xml +14 -0
- data/spec/fixtures/updates.xml +35 -0
- data/spec/functionals/actor_spec.rb +30 -0
- data/spec/functionals/banner_spec.rb +30 -0
- data/spec/functionals/episode_spec.rb +85 -0
- data/spec/functionals/search_spec.rb +71 -0
- data/spec/functionals/series_spec.rb +48 -0
- data/spec/functionals/update_spec.rb +81 -0
- data/thetvdb_api.gemspec +2 -2
- metadata +34 -82
- data/lib/generators/templates/thetvdb_api.rb +0 -3
- data/lib/generators/thetvdb_api/install_generator.rb +0 -12
- data/lib/thetvdb_api/configuration.rb +0 -10
- data/lib/thetvdb_api/response/actors.rb +0 -7
- data/lib/thetvdb_api/response/banners.rb +0 -7
- data/lib/thetvdb_api/response/collection.rb +0 -9
- data/lib/thetvdb_api/response/episode.rb +0 -5
- data/lib/thetvdb_api/response/full_series.rb +0 -21
- data/lib/thetvdb_api/response/search_multiple_episode.rb +0 -7
- data/lib/thetvdb_api/response/search_multiple_series.rb +0 -7
- data/lib/thetvdb_api/response/search_series.rb +0 -5
- data/lib/thetvdb_api/response/series.rb +0 -5
- data/lib/thetvdb_api/response/update.rb +0 -31
- data/lib/thetvdb_api/response.rb +0 -52
- data/spec/functionals/classes/actor_spec.rb +0 -41
- data/spec/functionals/classes/banner_spec.rb +0 -42
- data/spec/functionals/classes/episode_spec.rb +0 -93
- data/spec/functionals/classes/series_spec.rb +0 -91
- data/spec/functionals/functional_spec_helper.rb +0 -7
- data/spec/functionals/support/stub_faraday.rb +0 -5
- data/spec/integrations/support/.keep +0 -0
- data/spec/units/classes/actor_spec.rb +0 -49
- data/spec/units/classes/banner_spec.rb +0 -49
- data/spec/units/classes/base_spec.rb +0 -123
- data/spec/units/classes/client_spec.rb +0 -41
- data/spec/units/classes/episode_spec.rb +0 -167
- data/spec/units/classes/response/actors_spec.rb +0 -15
- data/spec/units/classes/response/banners_spec.rb +0 -15
- data/spec/units/classes/response/collection_spec.rb +0 -38
- data/spec/units/classes/response/episode_spec.rb +0 -15
- data/spec/units/classes/response/full_series_spec.rb +0 -51
- data/spec/units/classes/response/search_multiple_episode_spec.rb +0 -15
- data/spec/units/classes/response/search_multiple_series_spec.rb +0 -15
- data/spec/units/classes/response/search_series_spec.rb +0 -15
- data/spec/units/classes/response/series_spec.rb +0 -15
- data/spec/units/classes/response/update_spec.rb +0 -79
- data/spec/units/classes/response_spec.rb +0 -100
- data/spec/units/classes/search_spec.rb +0 -178
- data/spec/units/classes/series_spec.rb +0 -92
- data/spec/units/classes/update_spec.rb +0 -178
- data/spec/units/unit_spec_helper.rb +0 -5
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Response::SearchMultipleEpisode do
|
4
|
-
let(:klass) { ThetvdbApi::Response::SearchMultipleEpisode }
|
5
|
-
let(:model) { klass.new(faraday_response) }
|
6
|
-
let(:faraday_response) { double(env: true, status: true, headers: true, body: 'TEST') }
|
7
|
-
|
8
|
-
describe '.xml_parse' do
|
9
|
-
it 'should return correct data' do
|
10
|
-
model.stub(:multi_xml_parse).and_return({ 'Data' => { 'Episode' => 'EPISODE DATA' } })
|
11
|
-
|
12
|
-
model.xml_parse.should == 'EPISODE DATA'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Response::SearchMultipleSeries do
|
4
|
-
let(:klass) { ThetvdbApi::Response::SearchMultipleSeries }
|
5
|
-
let(:model) { klass.new(faraday_response) }
|
6
|
-
let(:faraday_response) { double(env: true, status: true, headers: true, body: 'TEST') }
|
7
|
-
|
8
|
-
describe '.xml_parse' do
|
9
|
-
it 'should return correct data' do
|
10
|
-
model.stub(:multi_xml_parse).and_return({ 'Data' => { 'Series' => 'SERIES DATA' } })
|
11
|
-
|
12
|
-
model.xml_parse.should == 'SERIES DATA'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Response::SearchSeries do
|
4
|
-
let(:klass) { ThetvdbApi::Response::SearchSeries }
|
5
|
-
let(:model) { klass.new(faraday_response) }
|
6
|
-
let(:faraday_response) { double(env: true, status: true, headers: true, body: 'TEST') }
|
7
|
-
|
8
|
-
describe '.xml_parse' do
|
9
|
-
it 'should return correct data' do
|
10
|
-
model.stub(:multi_xml_parse).and_return({ 'Data' => { 'Series' => 'SERIES DATA' } })
|
11
|
-
|
12
|
-
model.xml_parse.should == 'SERIES DATA'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Response::Series do
|
4
|
-
let(:klass) { ThetvdbApi::Response::Series }
|
5
|
-
let(:model) { klass.new(faraday_response) }
|
6
|
-
let(:faraday_response) { double(env: true, status: true, headers: true, body: 'TEST') }
|
7
|
-
|
8
|
-
describe '.xml_parse' do
|
9
|
-
it 'should return correct data' do
|
10
|
-
model.stub(:multi_xml_parse).and_return({ 'Data' => { 'Series' => 'SERIES DATA' } })
|
11
|
-
|
12
|
-
model.xml_parse.should == 'SERIES DATA'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Response::Update do
|
4
|
-
let(:klass) { ThetvdbApi::Response::Update }
|
5
|
-
let(:model) { klass.new(faraday_response) }
|
6
|
-
let(:faraday_response) { double(env: true, status: true, headers: true, body: 'TEST') }
|
7
|
-
|
8
|
-
describe '.parse' do
|
9
|
-
before do
|
10
|
-
model.stub(:xml_parse).and_return({ 'Data' => { 'Series' => [], 'Episode' => [], 'Banner' => [] } })
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should call xml_parse' do
|
14
|
-
model.should_receive(:xml_parse)
|
15
|
-
|
16
|
-
model.parse
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should call series_normalize' do
|
20
|
-
model.should_receive(:series_normalize)
|
21
|
-
|
22
|
-
model.parse
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should call episode_normalize' do
|
26
|
-
model.should_receive(:episode_normalize)
|
27
|
-
|
28
|
-
model.parse
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should call banner_normalize' do
|
32
|
-
model.should_receive(:banner_normalize)
|
33
|
-
|
34
|
-
model.parse
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe '.xml_parse' do
|
39
|
-
it 'should return correct data' do
|
40
|
-
model.stub(:multi_xml_parse).and_return({ 'Data' => 'UPDATE DATA' })
|
41
|
-
|
42
|
-
model.xml_parse.should == 'UPDATE DATA'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe '.series_normalize' do
|
47
|
-
it 'should call normalize with Series argument' do
|
48
|
-
model.should_receive(:normalize).with('Series')
|
49
|
-
|
50
|
-
model.series_normalize
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe '.episode_normalize' do
|
55
|
-
it 'should call normalize with Episode argument' do
|
56
|
-
model.should_receive(:normalize).with('Episode')
|
57
|
-
|
58
|
-
model.episode_normalize
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe '.banner_normalize' do
|
63
|
-
it 'should call normalize with Banner argument' do
|
64
|
-
model.should_receive(:normalize).with('Banner')
|
65
|
-
|
66
|
-
model.banner_normalize
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
describe '.normalize' do
|
71
|
-
it 'should convert hash to array' do
|
72
|
-
model.instance_variable_set('@parse', { 'Series' => {} })
|
73
|
-
|
74
|
-
model.normalize('Series')
|
75
|
-
|
76
|
-
model.parse['Series'].should == [{}]
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,100 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Search do
|
4
|
-
let(:klass) { ThetvdbApi::Response }
|
5
|
-
let(:model) { klass.new(faraday_response) }
|
6
|
-
let(:faraday_response) { double(env: true, status: true, headers: true, body: 'TEST') }
|
7
|
-
|
8
|
-
describe '.env' do
|
9
|
-
it 'should call env in faraday_response' do
|
10
|
-
faraday_response.should_receive(:env)
|
11
|
-
|
12
|
-
model.env
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '.status' do
|
17
|
-
it 'should call status in faraday_response' do
|
18
|
-
faraday_response.should_receive(:status)
|
19
|
-
|
20
|
-
model.status
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe '.headers' do
|
25
|
-
it 'should call headers in faraday_response' do
|
26
|
-
faraday_response.should_receive(:headers)
|
27
|
-
|
28
|
-
model.headers
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe '.body' do
|
33
|
-
it 'should map response when give mapper' do
|
34
|
-
model = klass.new(faraday_response, true)
|
35
|
-
model.should_receive(:parse)
|
36
|
-
|
37
|
-
model.body
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'should return string' do
|
41
|
-
model.body.class.should == String
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe '.inspect' do
|
46
|
-
it 'should return correct string' do
|
47
|
-
model.stub(:body).and_return('BODY')
|
48
|
-
model.inspect.should == '"BODY"'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe '[]' do
|
53
|
-
it 'should return correct string' do
|
54
|
-
model.stub(:parse).and_return({'test' => 'output'})
|
55
|
-
model['test'].should == 'output'
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe '[]=' do
|
60
|
-
it 'should return correct string' do
|
61
|
-
model.stub(:parse).and_return({'test' => 'output'})
|
62
|
-
model['test'] = 'output2'
|
63
|
-
|
64
|
-
model['test'].should == 'output2'
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe '.each' do
|
69
|
-
it 'should call each on parsed value' do
|
70
|
-
model.stub(:parse).and_return([])
|
71
|
-
model.parse.should_receive(:each)
|
72
|
-
|
73
|
-
model.each {}
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
describe '.multi_xml_parse' do
|
78
|
-
it 'should call parse on MultiXml' do
|
79
|
-
MultiXml.should_receive(:parse)
|
80
|
-
|
81
|
-
model.multi_xml_parse
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
describe '.xml_parse' do
|
86
|
-
it 'should call parse on MultiXml' do
|
87
|
-
model.should_receive(:multi_xml_parse)
|
88
|
-
|
89
|
-
model.xml_parse
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe '.parse' do
|
94
|
-
it 'should call multi_xml_parse' do
|
95
|
-
model.should_receive(:multi_xml_parse)
|
96
|
-
|
97
|
-
model.parse
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
@@ -1,178 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Search do
|
4
|
-
let(:klass) { ThetvdbApi::Search }
|
5
|
-
let(:model) { klass.new(ThetvdbApi::Client.new(api_key: '123456789')) }
|
6
|
-
|
7
|
-
describe '.get_series' do
|
8
|
-
it 'should call find_get_with_params with specific arguments' do
|
9
|
-
model.should_receive(:get_series_get_with_params).with('buffy', {}).and_return(double(response: true))
|
10
|
-
|
11
|
-
model.get_series('buffy')
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should call response with specific arguments' do
|
15
|
-
model.should_receive(:response).with(ThetvdbApi::Response::SearchMultipleSeries)
|
16
|
-
|
17
|
-
model.get_series('buffy')
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '.get_series_url' do
|
22
|
-
it 'should call find_get_with_params with specific arguments' do
|
23
|
-
model.should_receive(:get_series_get_with_params).with('buffy', {}).and_return(double(url: true))
|
24
|
-
|
25
|
-
model.get_series_url('buffy')
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should call url' do
|
29
|
-
model.should_receive(:url)
|
30
|
-
|
31
|
-
model.get_series_url('buffy')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '.get_series_get_with_params' do
|
36
|
-
it 'should call get with specific arguments' do
|
37
|
-
model.stub(:get_series_path).and_return('PATH')
|
38
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
39
|
-
|
40
|
-
model.get_series_get_with_params('buffy', {})
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'should call params with specific arguments' do
|
44
|
-
model.should_receive(:params).with(seriesname: 'buffy')
|
45
|
-
|
46
|
-
model.get_series_get_with_params('buffy', {})
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe '.get_series_by_imdb_id' do
|
51
|
-
it 'should call find_get_with_params with specific arguments' do
|
52
|
-
model.should_receive(:get_series_by_imdb_id_get_with_params).with('1234', {}).and_return(double(response: true))
|
53
|
-
|
54
|
-
model.get_series_by_imdb_id('1234')
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'should call response with specific arguments' do
|
58
|
-
model.should_receive(:response).with(ThetvdbApi::Response::SearchSeries)
|
59
|
-
|
60
|
-
model.get_series_by_imdb_id('1234')
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
describe '.get_series_by_imdb_id_url' do
|
65
|
-
it 'should call find_get_with_params with specific arguments' do
|
66
|
-
model.should_receive(:get_series_by_imdb_id_get_with_params).with('1234', {}).and_return(double(url: true))
|
67
|
-
|
68
|
-
model.get_series_by_imdb_id_url('1234')
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'should call url' do
|
72
|
-
model.should_receive(:url)
|
73
|
-
|
74
|
-
model.get_series_by_imdb_id_url('1234')
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
describe '.get_series_by_imdb_id_get_with_params' do
|
79
|
-
it 'should call get with specific arguments' do
|
80
|
-
model.stub(:get_series_by_remote_id_path).and_return('PATH')
|
81
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
82
|
-
|
83
|
-
model.get_series_by_imdb_id_get_with_params('1234', {})
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'should call params with specific arguments' do
|
87
|
-
model.should_receive(:params).with(imdbid: '1234')
|
88
|
-
|
89
|
-
model.get_series_by_imdb_id_get_with_params('1234', {})
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe '.get_series_by_zap2it_id' do
|
94
|
-
it 'should call find_get_with_params with specific arguments' do
|
95
|
-
model.should_receive(:get_series_by_zap2it_id_get_with_params).with('1234', {}).and_return(double(response: true))
|
96
|
-
|
97
|
-
model.get_series_by_zap2it_id('1234')
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'should call response with specific arguments' do
|
101
|
-
model.should_receive(:response).with(ThetvdbApi::Response::SearchSeries)
|
102
|
-
|
103
|
-
model.get_series_by_zap2it_id('1234')
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe '.get_series_by_zap2it_id_url' do
|
108
|
-
it 'should call find_get_with_params with specific arguments' do
|
109
|
-
model.should_receive(:get_series_by_zap2it_id_get_with_params).with('1234', {}).and_return(double(url: true))
|
110
|
-
|
111
|
-
model.get_series_by_zap2it_id_url('1234')
|
112
|
-
end
|
113
|
-
|
114
|
-
it 'should call url' do
|
115
|
-
model.should_receive(:url)
|
116
|
-
|
117
|
-
model.get_series_by_zap2it_id_url('1234')
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
describe '.get_series_by_imdb_id_get_with_params' do
|
122
|
-
it 'should call get with specific arguments' do
|
123
|
-
model.stub(:get_series_by_remote_id_path).and_return('PATH')
|
124
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
125
|
-
|
126
|
-
model.get_series_by_zap2it_id_get_with_params('1234', {})
|
127
|
-
end
|
128
|
-
|
129
|
-
it 'should call params with specific arguments' do
|
130
|
-
model.should_receive(:params).with(zap2it: '1234')
|
131
|
-
|
132
|
-
model.get_series_by_zap2it_id_get_with_params('1234', {})
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
describe '.get_episode' do
|
137
|
-
it 'should call find_get_with_params with specific arguments' do
|
138
|
-
model.should_receive(:get_episode_get_with_params).with('1234', '2000-01-01', {}).and_return(double(response: true))
|
139
|
-
|
140
|
-
model.get_episode('1234', '2000-01-01')
|
141
|
-
end
|
142
|
-
|
143
|
-
it 'should call response with specific arguments' do
|
144
|
-
model.should_receive(:response).with(ThetvdbApi::Response::SearchMultipleEpisode)
|
145
|
-
|
146
|
-
model.get_episode('1234', '2000-01-01')
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
describe '.get_episode_url' do
|
151
|
-
it 'should call find_get_with_params with specific arguments' do
|
152
|
-
model.should_receive(:get_episode_get_with_params).with('1234', '2000-01-01', {}).and_return(double(url: true))
|
153
|
-
|
154
|
-
model.get_episode_url('1234', '2000-01-01')
|
155
|
-
end
|
156
|
-
|
157
|
-
it 'should call url' do
|
158
|
-
model.should_receive(:url)
|
159
|
-
|
160
|
-
model.get_episode_url('1234', '2000-01-01')
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
describe '.get_episode_get_with_params' do
|
165
|
-
it 'should call get with specific arguments' do
|
166
|
-
model.stub(:get_episode_path).and_return('PATH')
|
167
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
168
|
-
|
169
|
-
model.get_episode_get_with_params('1234', '2000-01-01', {})
|
170
|
-
end
|
171
|
-
|
172
|
-
it 'should call params with specific arguments' do
|
173
|
-
model.should_receive(:params).with(seriesid: '1234', airdate: '2000-01-01')
|
174
|
-
|
175
|
-
model.get_episode_get_with_params('1234', '2000-01-01', {})
|
176
|
-
end
|
177
|
-
end
|
178
|
-
end
|
@@ -1,92 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Series do
|
4
|
-
let(:klass) { ThetvdbApi::Series }
|
5
|
-
let(:model) { klass.new(ThetvdbApi::Client.new(api_key: '123456789')) }
|
6
|
-
|
7
|
-
describe '.find' do
|
8
|
-
it 'should call find_get_with_params with specific arguments' do
|
9
|
-
model.should_receive(:find_get_with_params).with('1234', {}).and_return(double(response: true))
|
10
|
-
|
11
|
-
model.find('1234')
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should call response with specific arguments' do
|
15
|
-
model.should_receive(:response).with(ThetvdbApi::Response::Series)
|
16
|
-
|
17
|
-
model.find('1234')
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '.find_url' do
|
22
|
-
it 'should call find_get_with_params with specific arguments' do
|
23
|
-
model.should_receive(:find_get_with_params).with('1234', {}).and_return(double(url: true))
|
24
|
-
|
25
|
-
model.find_url('1234')
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should call url' do
|
29
|
-
model.should_receive(:url)
|
30
|
-
|
31
|
-
model.find_url('1234')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '.find_get_with_params' do
|
36
|
-
it 'should call get with specific arguments' do
|
37
|
-
model.stub(:find_path).and_return('PATH')
|
38
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
39
|
-
|
40
|
-
model.find_get_with_params('1234', {})
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'should call params with specific arguments' do
|
44
|
-
model.should_receive(:params).with(series_id: '1234')
|
45
|
-
|
46
|
-
model.find_get_with_params('1234', {})
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe '.find_full' do
|
51
|
-
it 'should call find_get_with_params with specific arguments' do
|
52
|
-
model.should_receive(:find_full_get_with_params).with('1234', {}).and_return(double(response: true))
|
53
|
-
|
54
|
-
model.find_full('1234')
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'should call response with specific arguments' do
|
58
|
-
model.should_receive(:response).with(ThetvdbApi::Response::FullSeries)
|
59
|
-
|
60
|
-
model.find_full('1234')
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
describe '.find_full_url' do
|
65
|
-
it 'should call find_get_with_params with specific arguments' do
|
66
|
-
model.should_receive(:find_full_get_with_params).with('1234', {}).and_return(double(url: true))
|
67
|
-
|
68
|
-
model.find_full_url('1234')
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'should call url' do
|
72
|
-
model.should_receive(:url)
|
73
|
-
|
74
|
-
model.find_full_url('1234')
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
describe '.find_full_get_with_params' do
|
79
|
-
it 'should call get with specific arguments' do
|
80
|
-
model.stub(:find_full_path).and_return('PATH')
|
81
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
82
|
-
|
83
|
-
model.find_full_get_with_params('1234', {})
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'should call params with specific arguments' do
|
87
|
-
model.should_receive(:params).with(series_id: '1234')
|
88
|
-
|
89
|
-
model.find_full_get_with_params('1234', {})
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
@@ -1,178 +0,0 @@
|
|
1
|
-
require 'units/unit_spec_helper'
|
2
|
-
|
3
|
-
describe ThetvdbApi::Update do
|
4
|
-
let(:klass) { ThetvdbApi::Update }
|
5
|
-
let(:model) { klass.new(ThetvdbApi::Client.new(api_key: '123456789')) }
|
6
|
-
|
7
|
-
describe '.day' do
|
8
|
-
it 'should call find_get_with_params with specific arguments' do
|
9
|
-
model.should_receive(:day_get_with_params).with({}).and_return(double(response: true))
|
10
|
-
|
11
|
-
model.day
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should call response with specific arguments' do
|
15
|
-
model.should_receive(:response).with(ThetvdbApi::Response::Update)
|
16
|
-
|
17
|
-
model.day
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '.day_url' do
|
22
|
-
it 'should call find_get_with_params with specific arguments' do
|
23
|
-
model.should_receive(:day_get_with_params).and_return(double(url: true))
|
24
|
-
|
25
|
-
model.day_url
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should call url' do
|
29
|
-
model.should_receive(:url)
|
30
|
-
|
31
|
-
model.day_url
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '.day_get_with_params' do
|
36
|
-
it 'should call get with specific arguments' do
|
37
|
-
model.stub(:day_path).and_return('PATH')
|
38
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
39
|
-
|
40
|
-
model.day_get_with_params
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'should call params with specific arguments' do
|
44
|
-
model.should_receive(:params).with({})
|
45
|
-
|
46
|
-
model.day_get_with_params
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe '.week' do
|
51
|
-
it 'should call find_get_with_params with specific arguments' do
|
52
|
-
model.should_receive(:week_get_with_params).with({}).and_return(double(response: true))
|
53
|
-
|
54
|
-
model.week
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'should call response with specific arguments' do
|
58
|
-
model.should_receive(:response).with(ThetvdbApi::Response::Update)
|
59
|
-
|
60
|
-
model.week
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
describe '.week_url' do
|
65
|
-
it 'should call find_get_with_params with specific arguments' do
|
66
|
-
model.should_receive(:week_get_with_params).and_return(double(url: true))
|
67
|
-
|
68
|
-
model.week_url
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'should call url' do
|
72
|
-
model.should_receive(:url)
|
73
|
-
|
74
|
-
model.week_url
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
describe '.week_get_with_params' do
|
79
|
-
it 'should call get with specific arguments' do
|
80
|
-
model.stub(:week_path).and_return('PATH')
|
81
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
82
|
-
|
83
|
-
model.week_get_with_params
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'should call params with specific arguments' do
|
87
|
-
model.should_receive(:params).with({})
|
88
|
-
|
89
|
-
model.week_get_with_params
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe '.month' do
|
94
|
-
it 'should call find_get_with_params with specific arguments' do
|
95
|
-
model.should_receive(:month_get_with_params).with({}).and_return(double(response: true))
|
96
|
-
|
97
|
-
model.month
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'should call response with specific arguments' do
|
101
|
-
model.should_receive(:response).with(ThetvdbApi::Response::Update)
|
102
|
-
|
103
|
-
model.month
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe '.month_url' do
|
108
|
-
it 'should call find_get_with_params with specific arguments' do
|
109
|
-
model.should_receive(:month_get_with_params).and_return(double(url: true))
|
110
|
-
|
111
|
-
model.month_url
|
112
|
-
end
|
113
|
-
|
114
|
-
it 'should call url' do
|
115
|
-
model.should_receive(:url)
|
116
|
-
|
117
|
-
model.month_url
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
describe '.month_get_with_params' do
|
122
|
-
it 'should call get with specific arguments' do
|
123
|
-
model.stub(:month_path).and_return('PATH')
|
124
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
125
|
-
|
126
|
-
model.month_get_with_params
|
127
|
-
end
|
128
|
-
|
129
|
-
it 'should call params with specific arguments' do
|
130
|
-
model.should_receive(:params).with({})
|
131
|
-
|
132
|
-
model.month_get_with_params
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
describe '.all' do
|
137
|
-
it 'should call find_get_with_params with specific arguments' do
|
138
|
-
model.should_receive(:all_get_with_params).with({}).and_return(double(response: true))
|
139
|
-
|
140
|
-
model.all
|
141
|
-
end
|
142
|
-
|
143
|
-
it 'should call response with specific arguments' do
|
144
|
-
model.should_receive(:response).with(ThetvdbApi::Response::Update)
|
145
|
-
|
146
|
-
model.all
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
describe '.all_url' do
|
151
|
-
it 'should call find_get_with_params with specific arguments' do
|
152
|
-
model.should_receive(:all_get_with_params).and_return(double(url: true))
|
153
|
-
|
154
|
-
model.all_url
|
155
|
-
end
|
156
|
-
|
157
|
-
it 'should call url' do
|
158
|
-
model.should_receive(:url)
|
159
|
-
|
160
|
-
model.all_url
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
describe '.all_get_with_params' do
|
165
|
-
it 'should call get with specific arguments' do
|
166
|
-
model.stub(:all_path).and_return('PATH')
|
167
|
-
model.should_receive(:get).with('PATH').and_return(double(params: true))
|
168
|
-
|
169
|
-
model.all_get_with_params
|
170
|
-
end
|
171
|
-
|
172
|
-
it 'should call params with specific arguments' do
|
173
|
-
model.should_receive(:params).with({})
|
174
|
-
|
175
|
-
model.all_get_with_params
|
176
|
-
end
|
177
|
-
end
|
178
|
-
end
|