traktr 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -2
- data/lib/traktr.rb +2 -11
- data/lib/traktr/account.rb +11 -8
- data/lib/traktr/client.rb +57 -0
- data/lib/traktr/movie.rb +33 -29
- data/lib/traktr/movies.rb +9 -5
- data/lib/traktr/search.rb +15 -11
- data/lib/traktr/show.rb +53 -37
- data/lib/traktr/show/episode.rb +30 -26
- data/lib/traktr/show/season.rb +12 -8
- data/lib/traktr/shows.rb +9 -5
- data/lib/traktr/user.rb +20 -16
- data/lib/traktr/user/calendar.rb +2 -2
- data/lib/traktr/user/library/movies.rb +6 -6
- data/lib/traktr/user/library/shows.rb +6 -6
- data/lib/traktr/user/network.rb +6 -6
- data/lib/traktr/user/progress.rb +4 -4
- data/lib/traktr/user/ratings.rb +6 -6
- data/lib/traktr/user/watchlist.rb +6 -6
- data/lib/traktr/version.rb +1 -1
- data/spec/account_spec.rb +9 -27
- data/spec/movie_spec.rb +38 -66
- data/spec/movies_spec.rb +9 -11
- data/spec/search_spec.rb +15 -20
- data/spec/show_episode_spec.rb +35 -63
- data/spec/show_season_spec.rb +11 -35
- data/spec/show_spec.rb +47 -76
- data/spec/shows_spec.rb +9 -11
- data/traktr.gemspec +2 -2
- metadata +6 -5
- data/lib/traktr/authentication.rb +0 -29
data/lib/traktr/version.rb
CHANGED
data/spec/account_spec.rb
CHANGED
@@ -4,61 +4,43 @@ describe Traktr::Account do
|
|
4
4
|
context 'POST methods' do
|
5
5
|
context 'with valid api_key and auth credentials' do
|
6
6
|
before :all do
|
7
|
-
Traktr.
|
8
|
-
Traktr.username = USERNAME
|
9
|
-
Traktr.password = PASSWORD
|
10
|
-
end
|
11
|
-
|
12
|
-
after :all do
|
13
|
-
Traktr.api_key = ''
|
14
|
-
Traktr.username = ''
|
15
|
-
Traktr.password = ''
|
7
|
+
@trakt = Traktr::Client.new(API_KEY, USERNAME, PASSWORD)
|
16
8
|
end
|
17
9
|
|
18
10
|
it '#settings' do
|
19
|
-
expect(
|
11
|
+
expect( @trakt.account.settings.status ).to eql('success')
|
20
12
|
end
|
21
13
|
|
22
14
|
it '#test' do
|
23
|
-
expect(
|
15
|
+
expect( @trakt.account.test.status ).to eql('success')
|
24
16
|
end
|
25
17
|
end
|
26
18
|
|
27
19
|
context 'without valid api_key' do
|
28
20
|
before :all do
|
29
|
-
Traktr.
|
30
|
-
Traktr.password = PASSWORD
|
31
|
-
end
|
32
|
-
|
33
|
-
after :all do
|
34
|
-
Traktr.username = ''
|
35
|
-
Traktr.password = ''
|
21
|
+
@trakt = Traktr::Client.new(nil, USERNAME, PASSWORD)
|
36
22
|
end
|
37
23
|
|
38
24
|
it '#settings' do
|
39
|
-
expect {
|
25
|
+
expect { @trakt.account.settings }.to raise_error(Traktr::ResponseError)
|
40
26
|
end
|
41
27
|
|
42
28
|
it '#test' do
|
43
|
-
expect {
|
29
|
+
expect { @trakt.account.test }.to raise_error(Traktr::ResponseError)
|
44
30
|
end
|
45
31
|
end
|
46
32
|
|
47
33
|
context 'without valid auth credentials' do
|
48
34
|
before :all do
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
after :all do
|
53
|
-
Traktr.api_key = ''
|
35
|
+
@trakt = Traktr::Client.new(API_KEY)
|
54
36
|
end
|
55
37
|
|
56
38
|
it '#settings' do
|
57
|
-
expect {
|
39
|
+
expect { @trakt.account.settings }.to raise_error(Traktr::ResponseError)
|
58
40
|
end
|
59
41
|
|
60
42
|
it '#test' do
|
61
|
-
expect {
|
43
|
+
expect { @trakt.account.test }.to raise_error(Traktr::ResponseError)
|
62
44
|
end
|
63
45
|
end
|
64
46
|
end
|
data/spec/movie_spec.rb
CHANGED
@@ -4,177 +4,149 @@ describe Traktr::Movie do
|
|
4
4
|
context 'GET methods' do
|
5
5
|
context 'with valid api_key' do
|
6
6
|
before :all do
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
after :all do
|
11
|
-
Traktr.api_key = ''
|
7
|
+
@trakt = Traktr::Client.new(API_KEY)
|
12
8
|
end
|
13
9
|
|
14
10
|
it '#comments' do
|
15
|
-
|
16
|
-
expect(comments.size).to be > 0
|
11
|
+
expect( @trakt.movie.comments('the-dark-knight-2008').size ).to be > 0
|
17
12
|
end
|
18
13
|
|
19
14
|
it '#summary' do
|
20
|
-
|
21
|
-
expect(summary.imdb_id).to eql('tt0468569')
|
15
|
+
expect( @trakt.movie.summary('the-dark-knight-2008').imdb_id ).to eql('tt0468569')
|
22
16
|
end
|
23
17
|
|
24
18
|
it '#summaries' do
|
25
|
-
|
26
|
-
expect(summaries.size).to eql(2)
|
19
|
+
expect( @trakt.movie.summaries(['the-dark-knight-2008', 'the-social-network-2010']).size ).to eql(2)
|
27
20
|
end
|
28
21
|
|
29
22
|
it '#watchingnow' do
|
30
|
-
|
31
|
-
expect(watchingnow.size).to be >= 0
|
23
|
+
expect( @trakt.movie.watchingnow('the-dark-knight-2008').size ).to be >= 0
|
32
24
|
end
|
33
25
|
|
34
26
|
it '#related' do
|
35
|
-
|
36
|
-
expect(related.size).to eql(10)
|
27
|
+
expect( @trakt.movie.related('the-dark-knight-2008').size ).to eql(10)
|
37
28
|
end
|
38
29
|
end
|
39
30
|
|
40
31
|
context 'without valid api_key' do
|
32
|
+
before :all do
|
33
|
+
@trakt = Traktr::Client.new(nil)
|
34
|
+
end
|
35
|
+
|
41
36
|
it '#comments' do
|
42
|
-
expect {
|
37
|
+
expect { @trakt.movie.comments('the-dark-knight-2008') }.to raise_error(Traktr::ResponseError)
|
43
38
|
end
|
44
39
|
|
45
40
|
it '#summary' do
|
46
|
-
expect {
|
41
|
+
expect { @trakt.movie.summary('the-dark-knight-2008') }.to raise_error(Traktr::ResponseError)
|
47
42
|
end
|
48
43
|
|
49
44
|
it '#summaries' do
|
50
|
-
expect {
|
45
|
+
expect { @trakt.movie.summaries(['the-dark-knight-2008', 'the-social-network-2010']) }.to raise_error(Traktr::ResponseError)
|
51
46
|
end
|
52
47
|
|
53
48
|
it '#watchingnow' do
|
54
|
-
expect {
|
49
|
+
expect { @trakt.movie.watchingnow('the-dark-knight-2008') }.to raise_error(Traktr::ResponseError)
|
55
50
|
end
|
56
51
|
|
57
52
|
it '#related' do
|
58
|
-
expect {
|
53
|
+
expect { @trakt.movie.related('the-dark-knight-2008') }.to raise_error(Traktr::ResponseError)
|
59
54
|
end
|
60
55
|
end
|
61
56
|
end
|
62
57
|
context 'POST methods' do
|
63
58
|
before :all do
|
64
|
-
|
65
|
-
@movie =
|
66
|
-
Traktr.api_key = ''
|
67
|
-
end
|
68
|
-
|
69
|
-
after :all do
|
70
|
-
@movie = nil
|
59
|
+
trakt = Traktr::Client.new(API_KEY)
|
60
|
+
@movie = trakt.movie.summary('the-dark-knight-2008')
|
71
61
|
end
|
72
62
|
|
73
63
|
context 'with valid api_key and auth credentials' do
|
74
64
|
before :all do
|
75
|
-
Traktr.
|
76
|
-
Traktr.username = USERNAME
|
77
|
-
Traktr.password = PASSWORD
|
78
|
-
end
|
79
|
-
|
80
|
-
after :all do
|
81
|
-
Traktr.api_key = ''
|
82
|
-
Traktr.username = ''
|
83
|
-
Traktr.password = ''
|
65
|
+
@trakt = Traktr::Client.new(API_KEY, USERNAME, PASSWORD)
|
84
66
|
end
|
85
67
|
|
86
68
|
it '#library' do
|
87
|
-
expect(
|
69
|
+
expect( @trakt.movie.library(@movie).status ).to eql('success')
|
88
70
|
end
|
89
71
|
|
90
72
|
it '#unlibrary' do
|
91
|
-
expect(
|
73
|
+
expect( @trakt.movie.unlibrary(@movie).status ).to eql('success')
|
92
74
|
end
|
93
75
|
|
94
76
|
it '#watchlist' do
|
95
|
-
expect(
|
77
|
+
expect( @trakt.movie.watchlist(@movie).status ).to eql('success')
|
96
78
|
end
|
97
79
|
|
98
80
|
it '#unwatchlist' do
|
99
|
-
expect(
|
81
|
+
expect( @trakt.movie.unwatchlist(@movie).status ).to eql('success')
|
100
82
|
end
|
101
83
|
|
102
84
|
it '#seen' do
|
103
|
-
expect(
|
85
|
+
expect( @trakt.movie.seen(@movie).status ).to eql('success')
|
104
86
|
end
|
105
87
|
|
106
88
|
it '#unseen' do
|
107
|
-
expect(
|
89
|
+
expect( @trakt.movie.unseen(@movie).status ).to eql('success')
|
108
90
|
end
|
109
91
|
end
|
110
92
|
|
111
93
|
context 'without valid api_key' do
|
112
94
|
before :all do
|
113
|
-
Traktr.
|
114
|
-
Traktr.password = PASSWORD
|
115
|
-
end
|
116
|
-
|
117
|
-
after :all do
|
118
|
-
Traktr.username = ''
|
119
|
-
Traktr.password = ''
|
95
|
+
@trakt = Traktr::Client.new(nil, USERNAME, PASSWORD)
|
120
96
|
end
|
121
97
|
|
122
98
|
it '#library' do
|
123
|
-
expect {
|
99
|
+
expect { @trakt.movie.library(@movie) }.to raise_error(Traktr::ResponseError)
|
124
100
|
end
|
125
101
|
|
126
102
|
it '#unlibrary' do
|
127
|
-
expect {
|
103
|
+
expect { @trakt.movie.unlibrary(@movie) }.to raise_error(Traktr::ResponseError)
|
128
104
|
end
|
129
105
|
|
130
106
|
it '#watchlist' do
|
131
|
-
expect {
|
107
|
+
expect { @trakt.movie.watchlist(@movie) }.to raise_error(Traktr::ResponseError)
|
132
108
|
end
|
133
109
|
|
134
110
|
it '#unwatchlist' do
|
135
|
-
expect {
|
111
|
+
expect { @trakt.movie.unwatchlist(@movie) }.to raise_error(Traktr::ResponseError)
|
136
112
|
end
|
137
113
|
|
138
114
|
it '#seen' do
|
139
|
-
expect {
|
115
|
+
expect { @trakt.movie.seen(@movie) }.to raise_error(Traktr::ResponseError)
|
140
116
|
end
|
141
117
|
|
142
118
|
it '#unseen' do
|
143
|
-
expect {
|
119
|
+
expect { @trakt.movie.unseen(@movie) }.to raise_error(Traktr::ResponseError)
|
144
120
|
end
|
145
121
|
end
|
146
122
|
|
147
123
|
context 'without valid auth credentials' do
|
148
124
|
before :all do
|
149
|
-
|
150
|
-
end
|
151
|
-
|
152
|
-
after :all do
|
153
|
-
Traktr.api_key = ''
|
125
|
+
@trakt = Traktr::Client.new(API_KEY)
|
154
126
|
end
|
155
127
|
|
156
128
|
it '#library' do
|
157
|
-
expect {
|
129
|
+
expect { @trakt.movie.library(@movie) }.to raise_error(Traktr::ResponseError)
|
158
130
|
end
|
159
131
|
|
160
132
|
it '#unlibrary' do
|
161
|
-
expect {
|
133
|
+
expect { @trakt.movie.unlibrary(@movie) }.to raise_error(Traktr::ResponseError)
|
162
134
|
end
|
163
135
|
|
164
136
|
it '#watchlist' do
|
165
|
-
expect {
|
137
|
+
expect { @trakt.movie.watchlist(@movie) }.to raise_error(Traktr::ResponseError)
|
166
138
|
end
|
167
139
|
|
168
140
|
it '#unwatchlist' do
|
169
|
-
expect {
|
141
|
+
expect { @trakt.movie.unwatchlist(@movie) }.to raise_error(Traktr::ResponseError)
|
170
142
|
end
|
171
143
|
|
172
144
|
it '#seen' do
|
173
|
-
expect {
|
145
|
+
expect { @trakt.movie.seen(@movie) }.to raise_error(Traktr::ResponseError)
|
174
146
|
end
|
175
147
|
|
176
148
|
it '#unseen' do
|
177
|
-
expect {
|
149
|
+
expect { @trakt.movie.unseen(@movie) }.to raise_error(Traktr::ResponseError)
|
178
150
|
end
|
179
151
|
end
|
180
152
|
end
|
data/spec/movies_spec.rb
CHANGED
@@ -4,31 +4,29 @@ describe Traktr::Movies do
|
|
4
4
|
context 'GET methods' do
|
5
5
|
context 'with valid api_key' do
|
6
6
|
before :all do
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
after :all do
|
11
|
-
Traktr.api_key = ''
|
7
|
+
@trakt = Traktr::Client.new(API_KEY)
|
12
8
|
end
|
13
9
|
|
14
10
|
it '#trending' do
|
15
|
-
movies
|
16
|
-
expect(movies.size).to be > 0
|
11
|
+
expect( @trakt.movies.trending.size ).to be > 0
|
17
12
|
end
|
18
13
|
|
19
14
|
it '#updated' do
|
20
|
-
|
21
|
-
expect(movies.size).to be > 0
|
15
|
+
expect( @trakt.movies.updated(Time.now - 3600 * 24).size ).to be > 0
|
22
16
|
end
|
23
17
|
end
|
24
18
|
|
25
19
|
context 'without valid api_key' do
|
20
|
+
before :all do
|
21
|
+
@trakt = Traktr::Client.new(nil)
|
22
|
+
end
|
23
|
+
|
26
24
|
it '#trending' do
|
27
|
-
expect {
|
25
|
+
expect { @trakt.movies.trending }.to raise_error(Traktr::ResponseError)
|
28
26
|
end
|
29
27
|
|
30
28
|
it '#updated' do
|
31
|
-
expect {
|
29
|
+
expect { @trakt.movies.updated(Time.now - 3600 * 24) }.to raise_error(Traktr::ResponseError)
|
32
30
|
end
|
33
31
|
end
|
34
32
|
end
|
data/spec/search_spec.rb
CHANGED
@@ -4,58 +4,53 @@ describe Traktr::Search do
|
|
4
4
|
context 'GET methods' do
|
5
5
|
context 'with valid api_key' do
|
6
6
|
before :all do
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
after :all do
|
11
|
-
Traktr.api_key = ''
|
7
|
+
@trakt = Traktr::Client.new(API_KEY)
|
12
8
|
end
|
13
9
|
|
14
10
|
it '#episodes' do
|
15
|
-
|
16
|
-
expect(results.size).to be > 0
|
11
|
+
expect( @trakt.search.episodes('warfare').size ).to be > 0
|
17
12
|
end
|
18
13
|
|
19
14
|
it '#movies' do
|
20
|
-
|
21
|
-
expect(results.size).to be > 0
|
15
|
+
expect( @trakt.search.movies('Batman').size ).to be > 0
|
22
16
|
end
|
23
17
|
|
24
18
|
it '#people' do
|
25
|
-
|
26
|
-
expect(results.size).to be > 0
|
19
|
+
expect( @trakt.search.people('christian bale').size ).to be > 0
|
27
20
|
end
|
28
21
|
|
29
22
|
it '#shows' do
|
30
|
-
|
31
|
-
expect(results.size).to be > 0
|
23
|
+
expect( @trakt.search.shows('big bang theory').size ).to be > 0
|
32
24
|
end
|
33
25
|
|
34
26
|
it '#users' do
|
35
|
-
|
36
|
-
expect(results.size).to be > 0
|
27
|
+
expect( @trakt.search.users('justin').size ).to be > 0
|
37
28
|
end
|
38
29
|
end
|
39
30
|
|
40
31
|
context 'without valid api_key' do
|
32
|
+
before :all do
|
33
|
+
@trakt = Traktr::Client.new(nil)
|
34
|
+
end
|
35
|
+
|
41
36
|
it '#episodes' do
|
42
|
-
expect {
|
37
|
+
expect { @trakt.search.episodes('warfare') }.to raise_error(Traktr::ResponseError)
|
43
38
|
end
|
44
39
|
|
45
40
|
it '#movies' do
|
46
|
-
expect {
|
41
|
+
expect { @trakt.search.movies('Batman') }.to raise_error(Traktr::ResponseError)
|
47
42
|
end
|
48
43
|
|
49
44
|
it '#people' do
|
50
|
-
expect {
|
45
|
+
expect { @trakt.search.people('christian bale') }.to raise_error(Traktr::ResponseError)
|
51
46
|
end
|
52
47
|
|
53
48
|
it '#shows' do
|
54
|
-
expect {
|
49
|
+
expect { @trakt.search.shows('big bang theory') }.to raise_error(Traktr::ResponseError)
|
55
50
|
end
|
56
51
|
|
57
52
|
it '#users' do
|
58
|
-
expect {
|
53
|
+
expect { @trakt.search.users('justin') }.to raise_error(Traktr::ResponseError)
|
59
54
|
end
|
60
55
|
end
|
61
56
|
end
|
data/spec/show_episode_spec.rb
CHANGED
@@ -16,163 +16,135 @@ describe Traktr::Show::Episode do
|
|
16
16
|
|
17
17
|
context 'with valid api_key' do
|
18
18
|
before :all do
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
after :all do
|
23
|
-
Traktr.api_key = ''
|
19
|
+
@trakt = Traktr::Client.new(API_KEY)
|
24
20
|
end
|
25
21
|
|
26
22
|
it '#comments' do
|
27
|
-
|
28
|
-
expect(comments.size).to be > 0
|
23
|
+
expect( @trakt.show.episode.comments(@show, @season, @episode).size ).to be > 0
|
29
24
|
end
|
30
25
|
|
31
26
|
it '#summary' do
|
32
|
-
|
33
|
-
expect(summary.show.imdb_id).to eql('tt1520211')
|
27
|
+
expect( @trakt.show.episode.summary(@show, @season, @episode).show.imdb_id ).to eql('tt1520211')
|
34
28
|
end
|
35
29
|
|
36
30
|
it '#watchingnow' do
|
37
|
-
|
38
|
-
expect(watchingnow.size).to be >= 0
|
31
|
+
expect( @trakt.show.episode.watchingnow(@show, @season, @episode).size ).to be >= 0
|
39
32
|
end
|
40
|
-
|
41
33
|
end
|
42
34
|
|
43
35
|
context 'without valid api_key' do
|
36
|
+
before :all do
|
37
|
+
@trakt = Traktr::Client.new(nil)
|
38
|
+
end
|
39
|
+
|
44
40
|
it '#comments' do
|
45
|
-
expect {
|
41
|
+
expect { @trakt.show.episode.comments(@show, @season, @episode) }.to raise_error(Traktr::ResponseError)
|
46
42
|
end
|
47
43
|
|
48
44
|
it '#summary' do
|
49
|
-
expect {
|
45
|
+
expect { @trakt.show.episode.summary(@show, @season, @episode) }.to raise_error(Traktr::ResponseError)
|
50
46
|
end
|
51
47
|
|
52
48
|
it '#watchingnow' do
|
53
|
-
expect {
|
49
|
+
expect { @trakt.show.episode.watchingnow(@show, @season, @episode) }.to raise_error(Traktr::ResponseError)
|
54
50
|
end
|
55
51
|
end
|
56
52
|
end
|
57
53
|
|
58
54
|
context 'POST methods' do
|
59
55
|
before :all do
|
60
|
-
Traktr.
|
61
|
-
@show =
|
62
|
-
@episodes =
|
63
|
-
Traktr.api_key = ''
|
64
|
-
end
|
65
|
-
|
66
|
-
after :all do
|
67
|
-
@show = nil
|
68
|
-
@episodes = nil
|
56
|
+
trakt = Traktr::Client.new(API_KEY)
|
57
|
+
@show = trakt.show.summary('the-walking-dead')
|
58
|
+
@episodes = trakt.show.season('the-walking-dead', 1)
|
69
59
|
end
|
70
60
|
|
71
61
|
context 'with valid api_key and auth credentials' do
|
72
62
|
before :all do
|
73
|
-
Traktr.
|
74
|
-
Traktr.username = USERNAME
|
75
|
-
Traktr.password = PASSWORD
|
76
|
-
end
|
77
|
-
|
78
|
-
after :all do
|
79
|
-
Traktr.api_key = ''
|
80
|
-
Traktr.username = ''
|
81
|
-
Traktr.password = ''
|
63
|
+
@trakt = Traktr::Client.new(API_KEY, USERNAME, PASSWORD)
|
82
64
|
end
|
83
65
|
|
84
66
|
it '#library' do
|
85
|
-
expect(
|
67
|
+
expect( @trakt.show.episode.library(@show, @episodes).status ).to eql('success')
|
86
68
|
end
|
87
69
|
|
88
70
|
it '#unlibrary' do
|
89
|
-
expect(
|
71
|
+
expect( @trakt.show.episode.unlibrary(@show, @episodes).status ).to eql('success')
|
90
72
|
end
|
91
73
|
|
92
74
|
it '#watchlist' do
|
93
|
-
expect(
|
75
|
+
expect( @trakt.show.episode.watchlist(@show, @episodes).status ).to eql('success')
|
94
76
|
end
|
95
77
|
|
96
78
|
it '#unwatchlist' do
|
97
|
-
expect(
|
79
|
+
expect( @trakt.show.episode.unwatchlist(@show, @episodes).status ).to eql('success')
|
98
80
|
end
|
99
81
|
|
100
82
|
it '#seen' do
|
101
|
-
expect(
|
83
|
+
expect( @trakt.show.episode.seen(@show, @episodes).status ).to eql('success')
|
102
84
|
end
|
103
85
|
|
104
86
|
it '#unseen' do
|
105
|
-
expect(
|
87
|
+
expect( @trakt.show.episode.unseen(@show, @episodes).status ).to eql('success')
|
106
88
|
end
|
107
89
|
end
|
108
90
|
|
109
91
|
context 'without valid api_key' do
|
110
92
|
before :all do
|
111
|
-
Traktr.
|
112
|
-
Traktr.password = PASSWORD
|
113
|
-
end
|
114
|
-
|
115
|
-
after :all do
|
116
|
-
Traktr.username = ''
|
117
|
-
Traktr.password = ''
|
93
|
+
@trakt = Traktr::Client.new(nil, USERNAME, PASSWORD)
|
118
94
|
end
|
119
95
|
|
120
96
|
it '#library' do
|
121
|
-
expect {
|
97
|
+
expect { @trakt.show.episode.library(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
122
98
|
end
|
123
99
|
|
124
100
|
it '#unlibrary' do
|
125
|
-
expect {
|
101
|
+
expect { @trakt.show.episode.unlibrary(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
126
102
|
end
|
127
103
|
|
128
104
|
it '#watchlist' do
|
129
|
-
expect {
|
105
|
+
expect { @trakt.show.episode.watchlist(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
130
106
|
end
|
131
107
|
|
132
108
|
it '#unwatchlist' do
|
133
|
-
expect {
|
109
|
+
expect { @trakt.show.episode.unwatchlist(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
134
110
|
end
|
135
111
|
|
136
112
|
it '#seen' do
|
137
|
-
expect {
|
113
|
+
expect { @trakt.show.episode.seen(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
138
114
|
end
|
139
115
|
|
140
116
|
it '#unseen' do
|
141
|
-
expect {
|
117
|
+
expect { @trakt.show.episode.unseen(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
142
118
|
end
|
143
119
|
end
|
144
120
|
|
145
121
|
context 'without valid auth credentials' do
|
146
122
|
before :all do
|
147
|
-
|
148
|
-
end
|
149
|
-
|
150
|
-
after :all do
|
151
|
-
Traktr.api_key = ''
|
123
|
+
@trakt = Traktr::Client.new(API_KEY)
|
152
124
|
end
|
153
125
|
|
154
126
|
it '#library' do
|
155
|
-
expect {
|
127
|
+
expect { @trakt.show.episode.library(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
156
128
|
end
|
157
129
|
|
158
130
|
it '#unlibrary' do
|
159
|
-
expect {
|
131
|
+
expect { @trakt.show.episode.unlibrary(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
160
132
|
end
|
161
133
|
|
162
134
|
it '#watchlist' do
|
163
|
-
expect {
|
135
|
+
expect { @trakt.show.episode.watchlist(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
164
136
|
end
|
165
137
|
|
166
138
|
it '#unwatchlist' do
|
167
|
-
expect {
|
139
|
+
expect { @trakt.show.episode.unwatchlist(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
168
140
|
end
|
169
141
|
|
170
142
|
it '#seen' do
|
171
|
-
expect {
|
143
|
+
expect { @trakt.show.episode.seen(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
172
144
|
end
|
173
145
|
|
174
146
|
it '#unseen' do
|
175
|
-
expect {
|
147
|
+
expect { @trakt.show.episode.unseen(@show, @episodes) }.to raise_error(Traktr::ResponseError)
|
176
148
|
end
|
177
149
|
end
|
178
150
|
end
|