trakt_api 0.0.3 → 0.1.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +3 -1
- data/README.md +21 -209
- data/lib/trakt_api.rb +3 -17
- data/lib/trakt_api/base.rb +35 -68
- data/lib/trakt_api/client.rb +6 -67
- data/lib/trakt_api/search.rb +7 -18
- data/lib/trakt_api/version.rb +1 -1
- data/spec/fixtures/search.json +125 -0
- data/spec/functionals/search_spec.rb +23 -0
- data/spec/integrations/search_spec.rb +9 -30
- data/spec/spec_helper.rb +2 -38
- data/spec/support/.keep +0 -0
- data/spec/support/trakt_api.rb.example +1 -0
- data/trakt_api.gemspec +4 -3
- metadata +42 -94
- data/lib/generators/templates/trakt_api.rb +0 -5
- data/lib/generators/trakt_api/install_generator.rb +0 -12
- data/lib/trakt_api/account.rb +0 -16
- data/lib/trakt_api/activity.rb +0 -94
- data/lib/trakt_api/calendar.rb +0 -17
- data/lib/trakt_api/comment.rb +0 -16
- data/lib/trakt_api/configuration.rb +0 -7
- data/lib/trakt_api/genres.rb +0 -11
- data/lib/trakt_api/lists.rb +0 -26
- data/lib/trakt_api/movie.rb +0 -86
- data/lib/trakt_api/movies.rb +0 -11
- data/lib/trakt_api/network.rb +0 -26
- data/lib/trakt_api/rate.rb +0 -31
- data/lib/trakt_api/recommendations.rb +0 -21
- data/lib/trakt_api/server.rb +0 -6
- data/lib/trakt_api/show.rb +0 -151
- data/lib/trakt_api/shows.rb +0 -11
- data/lib/trakt_api/user.rb +0 -116
- data/spec/integration_spec_helper.rb +0 -3
- data/spec/integrations/account_spec.rb +0 -19
- data/spec/integrations/calendar_spec.rb +0 -31
- data/spec/integrations/client_spec.rb +0 -173
- data/spec/integrations/genres_spec.rb +0 -19
- data/spec/integrations/movies_spec.rb +0 -25
- data/spec/integrations/network_spec.rb +0 -37
- data/spec/integrations/server_spec.rb +0 -13
- data/spec/integrations/shows_spec.rb +0 -25
- data/spec/integrations/support/trakt_api.rb.example +0 -5
- data/spec/trakt_api/account_spec.rb +0 -56
- data/spec/trakt_api/activity_spec.rb +0 -243
- data/spec/trakt_api/base_spec.rb +0 -140
- data/spec/trakt_api/calendar_spec.rb +0 -48
- data/spec/trakt_api/client_spec.rb +0 -101
- data/spec/trakt_api/comment_spec.rb +0 -69
- data/spec/trakt_api/genres_spec.rb +0 -24
- data/spec/trakt_api/lists_spec.rb +0 -111
- data/spec/trakt_api/movie_spec.rb +0 -345
- data/spec/trakt_api/movies_spec.rb +0 -44
- data/spec/trakt_api/network_spec.rb +0 -105
- data/spec/trakt_api/rate_spec.rb +0 -132
- data/spec/trakt_api/recommendations_spec.rb +0 -90
- data/spec/trakt_api/search_spec.rb +0 -81
- data/spec/trakt_api/server_spec.rb +0 -15
- data/spec/trakt_api/show_spec.rb +0 -618
- data/spec/trakt_api/shows_spec.rb +0 -44
- data/spec/trakt_api/user_spec.rb +0 -489
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::Shows do
|
4
|
-
let(:model) { TraktApi::Shows.new(TraktApi::Client.new) }
|
5
|
-
let(:mock_model) { SampleModel.new }
|
6
|
-
|
7
|
-
describe '.trending' do
|
8
|
-
it 'should call get with specific params' do
|
9
|
-
model.instance_variable_set("@method", :get)
|
10
|
-
model.should_receive(:get).with('shows/trending').and_return(mock_model)
|
11
|
-
|
12
|
-
model.trending
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should call params' do
|
16
|
-
model.should_receive(:params).and_return(mock_model)
|
17
|
-
|
18
|
-
model.trending
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe '.updated' do
|
23
|
-
let(:time) { Time.now.to_i }
|
24
|
-
|
25
|
-
it 'should call get with specific params' do
|
26
|
-
model.instance_variable_set("@method", :get)
|
27
|
-
model.should_receive(:get).with('shows/updated').and_return(mock_model)
|
28
|
-
|
29
|
-
model.updated(time: time)
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'should call params' do
|
33
|
-
model.should_receive(:params).and_return(mock_model)
|
34
|
-
|
35
|
-
model.updated(time: time)
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should call restful_params' do
|
39
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
40
|
-
|
41
|
-
model.updated(time: time)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
data/spec/trakt_api/user_spec.rb
DELETED
@@ -1,489 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe TraktApi::User do
|
4
|
-
let(:model) { TraktApi::User.new(TraktApi::Client.new) }
|
5
|
-
let(:mock_model) { SampleModel.new }
|
6
|
-
|
7
|
-
describe '.calendar_shows' do
|
8
|
-
it 'should call get with specific params' do
|
9
|
-
model.instance_variable_set("@method", :get)
|
10
|
-
model.should_receive(:get).with('user/calendar/shows').and_return(mock_model)
|
11
|
-
|
12
|
-
model.calendar_shows
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should call params' do
|
16
|
-
model.should_receive(:params).and_return(mock_model)
|
17
|
-
|
18
|
-
model.calendar_shows
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should call restful_params' do
|
22
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
23
|
-
|
24
|
-
model.calendar_shows
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe '.last_activity' do
|
29
|
-
it 'should call get with specific params' do
|
30
|
-
model.instance_variable_set("@method", :get)
|
31
|
-
model.should_receive(:get).with('user/lastactivity').and_return(mock_model)
|
32
|
-
|
33
|
-
model.last_activity
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'should call params' do
|
37
|
-
model.should_receive(:params).and_return(mock_model)
|
38
|
-
|
39
|
-
model.last_activity
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should call restful_params' do
|
43
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
44
|
-
|
45
|
-
model.last_activity
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe '.library_movies_all' do
|
50
|
-
it 'should call get with specific params' do
|
51
|
-
model.instance_variable_set("@method", :get)
|
52
|
-
model.should_receive(:get).with('user/library/movies/all').and_return(mock_model)
|
53
|
-
|
54
|
-
model.library_movies_all
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'should call params' do
|
58
|
-
model.should_receive(:params).and_return(mock_model)
|
59
|
-
|
60
|
-
model.library_movies_all
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'should call restful_params' do
|
64
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
65
|
-
|
66
|
-
model.library_movies_all
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
describe '.library_movies_collection' do
|
71
|
-
it 'should call get with specific params' do
|
72
|
-
model.instance_variable_set("@method", :get)
|
73
|
-
model.should_receive(:get).with('user/library/movies/collection').and_return(mock_model)
|
74
|
-
|
75
|
-
model.library_movies_collection
|
76
|
-
end
|
77
|
-
|
78
|
-
it 'should call params' do
|
79
|
-
model.should_receive(:params).and_return(mock_model)
|
80
|
-
|
81
|
-
model.library_movies_collection
|
82
|
-
end
|
83
|
-
|
84
|
-
it 'should call restful_params' do
|
85
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
86
|
-
|
87
|
-
model.library_movies_all
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
describe '.library_movies_watched' do
|
92
|
-
it 'should call get with specific params' do
|
93
|
-
model.instance_variable_set("@method", :get)
|
94
|
-
model.should_receive(:get).with('user/library/movies/watched').and_return(mock_model)
|
95
|
-
|
96
|
-
model.library_movies_watched
|
97
|
-
end
|
98
|
-
|
99
|
-
it 'should call params' do
|
100
|
-
model.should_receive(:params).and_return(mock_model)
|
101
|
-
|
102
|
-
model.library_movies_watched
|
103
|
-
end
|
104
|
-
|
105
|
-
it 'should call restful_params' do
|
106
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
107
|
-
|
108
|
-
model.library_movies_all
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
describe '.library_shows_all' do
|
113
|
-
it 'should call get with specific params' do
|
114
|
-
model.instance_variable_set("@method", :get)
|
115
|
-
model.should_receive(:get).with('user/library/shows/all').and_return(mock_model)
|
116
|
-
|
117
|
-
model.library_shows_all
|
118
|
-
end
|
119
|
-
|
120
|
-
it 'should call params' do
|
121
|
-
model.should_receive(:params).and_return(mock_model)
|
122
|
-
|
123
|
-
model.library_shows_all
|
124
|
-
end
|
125
|
-
|
126
|
-
it 'should call restful_params' do
|
127
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
128
|
-
|
129
|
-
model.library_movies_all
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
describe '.library_shows_collection' do
|
134
|
-
it 'should call get with specific params' do
|
135
|
-
model.instance_variable_set("@method", :get)
|
136
|
-
model.should_receive(:get).with('user/library/shows/collection').and_return(mock_model)
|
137
|
-
|
138
|
-
model.library_shows_collection
|
139
|
-
end
|
140
|
-
|
141
|
-
it 'should call params' do
|
142
|
-
model.should_receive(:params).and_return(mock_model)
|
143
|
-
|
144
|
-
model.library_shows_collection
|
145
|
-
end
|
146
|
-
|
147
|
-
it 'should call restful_params' do
|
148
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
149
|
-
|
150
|
-
model.library_movies_collection
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
describe '.library_shows_watched' do
|
155
|
-
it 'should call get with specific params' do
|
156
|
-
model.instance_variable_set("@method", :get)
|
157
|
-
model.should_receive(:get).with('user/library/shows/watched').and_return(mock_model)
|
158
|
-
|
159
|
-
model.library_shows_watched
|
160
|
-
end
|
161
|
-
|
162
|
-
it 'should call params' do
|
163
|
-
model.should_receive(:params).and_return(mock_model)
|
164
|
-
|
165
|
-
model.library_shows_watched
|
166
|
-
end
|
167
|
-
|
168
|
-
it 'should call restful_params' do
|
169
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
170
|
-
|
171
|
-
model.library_movies_watched
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
describe '.list' do
|
176
|
-
it 'should call get with specific params' do
|
177
|
-
model.instance_variable_set("@method", :get)
|
178
|
-
model.should_receive(:get).with('user/list').and_return(mock_model)
|
179
|
-
|
180
|
-
model.list
|
181
|
-
end
|
182
|
-
|
183
|
-
it 'should call params' do
|
184
|
-
model.should_receive(:params).and_return(mock_model)
|
185
|
-
|
186
|
-
model.list
|
187
|
-
end
|
188
|
-
|
189
|
-
it 'should call restful_params' do
|
190
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
191
|
-
|
192
|
-
model.list
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
describe '.lists' do
|
197
|
-
it 'should call get with specific params' do
|
198
|
-
model.instance_variable_set("@method", :get)
|
199
|
-
model.should_receive(:get).with('user/lists').and_return(mock_model)
|
200
|
-
|
201
|
-
model.lists
|
202
|
-
end
|
203
|
-
|
204
|
-
it 'should call params' do
|
205
|
-
model.should_receive(:params).and_return(mock_model)
|
206
|
-
|
207
|
-
model.lists
|
208
|
-
end
|
209
|
-
|
210
|
-
it 'should call restful_params' do
|
211
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
212
|
-
|
213
|
-
model.lists
|
214
|
-
end
|
215
|
-
end
|
216
|
-
|
217
|
-
describe '.network_followers' do
|
218
|
-
it 'should call get with specific params' do
|
219
|
-
model.instance_variable_set("@method", :get)
|
220
|
-
model.should_receive(:get).with('user/network/followers').and_return(mock_model)
|
221
|
-
|
222
|
-
model.network_followers
|
223
|
-
end
|
224
|
-
|
225
|
-
it 'should call params' do
|
226
|
-
model.should_receive(:params).and_return(mock_model)
|
227
|
-
|
228
|
-
model.network_followers
|
229
|
-
end
|
230
|
-
|
231
|
-
it 'should call restful_params' do
|
232
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
233
|
-
|
234
|
-
model.network_followers
|
235
|
-
end
|
236
|
-
end
|
237
|
-
|
238
|
-
describe '.network_following' do
|
239
|
-
it 'should call get with specific params' do
|
240
|
-
model.instance_variable_set("@method", :get)
|
241
|
-
model.should_receive(:get).with('user/network/following').and_return(mock_model)
|
242
|
-
|
243
|
-
model.network_following
|
244
|
-
end
|
245
|
-
|
246
|
-
it 'should call params' do
|
247
|
-
model.should_receive(:params).and_return(mock_model)
|
248
|
-
|
249
|
-
model.network_following
|
250
|
-
end
|
251
|
-
|
252
|
-
it 'should call restful_params' do
|
253
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
254
|
-
|
255
|
-
model.network_following
|
256
|
-
end
|
257
|
-
end
|
258
|
-
|
259
|
-
describe '.network_friends' do
|
260
|
-
it 'should call get with specific params' do
|
261
|
-
model.instance_variable_set("@method", :get)
|
262
|
-
model.should_receive(:get).with('user/network/friends').and_return(mock_model)
|
263
|
-
|
264
|
-
model.network_friends
|
265
|
-
end
|
266
|
-
|
267
|
-
it 'should call params' do
|
268
|
-
model.should_receive(:params).and_return(mock_model)
|
269
|
-
|
270
|
-
model.network_friends
|
271
|
-
end
|
272
|
-
|
273
|
-
it 'should call restful_params' do
|
274
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
275
|
-
|
276
|
-
model.network_friends
|
277
|
-
end
|
278
|
-
end
|
279
|
-
|
280
|
-
describe '.profile' do
|
281
|
-
it 'should call get with specific params' do
|
282
|
-
model.instance_variable_set("@method", :get)
|
283
|
-
model.should_receive(:get).with('user/profile').and_return(mock_model)
|
284
|
-
|
285
|
-
model.profile
|
286
|
-
end
|
287
|
-
|
288
|
-
it 'should call params' do
|
289
|
-
model.should_receive(:params).and_return(mock_model)
|
290
|
-
|
291
|
-
model.profile
|
292
|
-
end
|
293
|
-
|
294
|
-
it 'should call restful_params' do
|
295
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
296
|
-
|
297
|
-
model.profile
|
298
|
-
end
|
299
|
-
end
|
300
|
-
|
301
|
-
describe '.progress_collected' do
|
302
|
-
it 'should call get with specific params' do
|
303
|
-
model.instance_variable_set("@method", :get)
|
304
|
-
model.should_receive(:get).with('user/progress/collected').and_return(mock_model)
|
305
|
-
|
306
|
-
model.progress_collected
|
307
|
-
end
|
308
|
-
|
309
|
-
it 'should call params' do
|
310
|
-
model.should_receive(:params).and_return(mock_model)
|
311
|
-
|
312
|
-
model.progress_collected
|
313
|
-
end
|
314
|
-
|
315
|
-
it 'should call restful_params' do
|
316
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
317
|
-
|
318
|
-
model.progress_collected
|
319
|
-
end
|
320
|
-
end
|
321
|
-
|
322
|
-
describe '.progress_watched' do
|
323
|
-
it 'should call get with specific params' do
|
324
|
-
model.instance_variable_set("@method", :get)
|
325
|
-
model.should_receive(:get).with('user/progress/watched').and_return(mock_model)
|
326
|
-
|
327
|
-
model.progress_watched
|
328
|
-
end
|
329
|
-
|
330
|
-
it 'should call params' do
|
331
|
-
model.should_receive(:params).and_return(mock_model)
|
332
|
-
|
333
|
-
model.progress_watched
|
334
|
-
end
|
335
|
-
|
336
|
-
it 'should call restful_params' do
|
337
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
338
|
-
|
339
|
-
model.progress_watched
|
340
|
-
end
|
341
|
-
end
|
342
|
-
|
343
|
-
describe '.ratings_episodes' do
|
344
|
-
it 'should call get with specific params' do
|
345
|
-
model.instance_variable_set("@method", :get)
|
346
|
-
model.should_receive(:get).with('user/ratings/episodes').and_return(mock_model)
|
347
|
-
|
348
|
-
model.ratings_episodes
|
349
|
-
end
|
350
|
-
|
351
|
-
it 'should call params' do
|
352
|
-
model.should_receive(:params).and_return(mock_model)
|
353
|
-
|
354
|
-
model.ratings_episodes
|
355
|
-
end
|
356
|
-
|
357
|
-
it 'should call restful_params' do
|
358
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
359
|
-
|
360
|
-
model.ratings_episodes
|
361
|
-
end
|
362
|
-
end
|
363
|
-
|
364
|
-
describe '.ratings_movies' do
|
365
|
-
it 'should call get with specific params' do
|
366
|
-
model.instance_variable_set("@method", :get)
|
367
|
-
model.should_receive(:get).with('user/ratings/movies').and_return(mock_model)
|
368
|
-
|
369
|
-
model.ratings_movies
|
370
|
-
end
|
371
|
-
|
372
|
-
it 'should call params' do
|
373
|
-
model.should_receive(:params).and_return(mock_model)
|
374
|
-
|
375
|
-
model.ratings_movies
|
376
|
-
end
|
377
|
-
|
378
|
-
it 'should call restful_params' do
|
379
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
380
|
-
|
381
|
-
model.ratings_movies
|
382
|
-
end
|
383
|
-
end
|
384
|
-
|
385
|
-
describe '.ratings_shows' do
|
386
|
-
it 'should call get with specific params' do
|
387
|
-
model.instance_variable_set("@method", :get)
|
388
|
-
model.should_receive(:get).with('user/ratings/shows').and_return(mock_model)
|
389
|
-
|
390
|
-
model.ratings_shows
|
391
|
-
end
|
392
|
-
|
393
|
-
it 'should call params' do
|
394
|
-
model.should_receive(:params).and_return(mock_model)
|
395
|
-
|
396
|
-
model.ratings_shows
|
397
|
-
end
|
398
|
-
|
399
|
-
it 'should call restful_params' do
|
400
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
401
|
-
|
402
|
-
model.ratings_shows
|
403
|
-
end
|
404
|
-
end
|
405
|
-
|
406
|
-
describe '.watching' do
|
407
|
-
it 'should call get with specific params' do
|
408
|
-
model.instance_variable_set("@method", :get)
|
409
|
-
model.should_receive(:get).with('user/watching').and_return(mock_model)
|
410
|
-
|
411
|
-
model.watching
|
412
|
-
end
|
413
|
-
|
414
|
-
it 'should call params' do
|
415
|
-
model.should_receive(:params).and_return(mock_model)
|
416
|
-
|
417
|
-
model.watching
|
418
|
-
end
|
419
|
-
|
420
|
-
it 'should call restful_params' do
|
421
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
422
|
-
|
423
|
-
model.watching
|
424
|
-
end
|
425
|
-
end
|
426
|
-
|
427
|
-
describe '.watch_list_episode' do
|
428
|
-
it 'should call get with specific params' do
|
429
|
-
model.instance_variable_set("@method", :get)
|
430
|
-
model.should_receive(:get).with('user/watchlist/episodes').and_return(mock_model)
|
431
|
-
|
432
|
-
model.watch_list_episode
|
433
|
-
end
|
434
|
-
|
435
|
-
it 'should call params' do
|
436
|
-
model.should_receive(:params).and_return(mock_model)
|
437
|
-
|
438
|
-
model.watch_list_episode
|
439
|
-
end
|
440
|
-
|
441
|
-
it 'should call restful_params' do
|
442
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
443
|
-
|
444
|
-
model.watch_list_episode
|
445
|
-
end
|
446
|
-
end
|
447
|
-
|
448
|
-
describe '.watch_list_movies' do
|
449
|
-
it 'should call get with specific params' do
|
450
|
-
model.instance_variable_set("@method", :get)
|
451
|
-
model.should_receive(:get).with('user/watchlist/movies').and_return(mock_model)
|
452
|
-
|
453
|
-
model.watch_list_movies
|
454
|
-
end
|
455
|
-
|
456
|
-
it 'should call params' do
|
457
|
-
model.should_receive(:params).and_return(mock_model)
|
458
|
-
|
459
|
-
model.watch_list_movies
|
460
|
-
end
|
461
|
-
|
462
|
-
it 'should call restful_params' do
|
463
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
464
|
-
|
465
|
-
model.watch_list_movies
|
466
|
-
end
|
467
|
-
end
|
468
|
-
|
469
|
-
describe '.watch_list_shows' do
|
470
|
-
it 'should call get with specific params' do
|
471
|
-
model.instance_variable_set("@method", :get)
|
472
|
-
model.should_receive(:get).with('user/watchlist/shows').and_return(mock_model)
|
473
|
-
|
474
|
-
model.watch_list_shows
|
475
|
-
end
|
476
|
-
|
477
|
-
it 'should call params' do
|
478
|
-
model.should_receive(:params).and_return(mock_model)
|
479
|
-
|
480
|
-
model.watch_list_shows
|
481
|
-
end
|
482
|
-
|
483
|
-
it 'should call restful_params' do
|
484
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
485
|
-
|
486
|
-
model.watch_list_shows
|
487
|
-
end
|
488
|
-
end
|
489
|
-
end
|