themoviedb 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +459 -0
  3. data/lib/themoviedb.rb +4 -5
  4. data/lib/themoviedb/api.rb +4 -5
  5. data/lib/themoviedb/collection.rb +6 -7
  6. data/lib/themoviedb/company.rb +7 -8
  7. data/lib/themoviedb/configuration.rb +2 -2
  8. data/lib/themoviedb/episode.rb +16 -17
  9. data/lib/themoviedb/find.rb +11 -12
  10. data/lib/themoviedb/genre.rb +53 -57
  11. data/lib/themoviedb/job.rb +3 -5
  12. data/lib/themoviedb/movie.rb +62 -63
  13. data/lib/themoviedb/person.rb +37 -33
  14. data/lib/themoviedb/resource.rb +19 -21
  15. data/lib/themoviedb/search.rb +30 -30
  16. data/lib/themoviedb/season.rb +16 -17
  17. data/lib/themoviedb/tv.rb +24 -25
  18. data/lib/themoviedb/version.rb +2 -1
  19. data/spec/company_spec.rb +31 -36
  20. data/spec/find_spec.rb +10 -13
  21. data/spec/movie_spec.rb +124 -129
  22. data/spec/person_spec.rb +53 -53
  23. data/spec/spec/vcr/find/search_imdb.yml +39 -0
  24. data/spec/spec_helper.rb +29 -0
  25. data/spec/tv_spec.rb +196 -217
  26. data/spec/vcr/company/detail.yml +67 -0
  27. data/spec/vcr/company/movies.yml +98 -0
  28. data/spec/vcr/find/search_imdb.yml +50 -0
  29. data/spec/vcr/find/search_tvdb.yml +52 -0
  30. data/spec/vcr/movie/alternative_titles_for_id.yml +69 -0
  31. data/spec/vcr/movie/cast_information_for_id.yml +109 -0
  32. data/spec/vcr/movie/changes_made.yml +60 -0
  33. data/spec/vcr/movie/credits_for_id.yml +99 -0
  34. data/spec/vcr/movie/crew_for_id.yml +109 -0
  35. data/spec/vcr/movie/detail.yml +93 -0
  36. data/spec/vcr/movie/detail_with_appended_response.yml +254 -0
  37. data/spec/vcr/movie/images.yml +62 -0
  38. data/spec/vcr/movie/keywords_for_id.yml +62 -0
  39. data/spec/vcr/movie/language_german.yml +112 -0
  40. data/spec/vcr/movie/movie_belongs_for_id.yml +89 -0
  41. data/spec/vcr/movie/now_playing.yml +90 -0
  42. data/spec/vcr/movie/popular.yml +96 -0
  43. data/spec/vcr/movie/releases_for_id.yml +60 -0
  44. data/spec/vcr/movie/return_latest_movie.yml +62 -0
  45. data/spec/vcr/movie/return_upcoming_movie.yml +186 -0
  46. data/spec/vcr/movie/similar_for_id.yml +180 -0
  47. data/spec/vcr/movie/top_rated.yml +190 -0
  48. data/spec/vcr/movie/trailers_for_id.yml +60 -0
  49. data/spec/vcr/movie/translations_for_id.yml +76 -0
  50. data/spec/vcr/person/changes.yml +50 -0
  51. data/spec/vcr/person/credits.yml +459 -0
  52. data/spec/vcr/person/detail.yml +65 -0
  53. data/spec/vcr/person/detail_with_appended_response.yml +762 -0
  54. data/spec/vcr/person/images.yml +50 -0
  55. data/spec/vcr/person/latest.yml +51 -0
  56. data/spec/vcr/person/popular.yml +125 -0
  57. data/spec/vcr/tv/cast.yml +74 -0
  58. data/spec/vcr/tv/crew.yml +74 -0
  59. data/spec/vcr/tv/detail.yml +63 -0
  60. data/spec/vcr/tv/detail_with_appeded_response.yml +76 -0
  61. data/spec/vcr/tv/external_ids.yml +60 -0
  62. data/spec/vcr/tv/images.yml +121 -0
  63. data/spec/vcr/tv/popular.yml +96 -0
  64. data/spec/vcr/tv/test_chuck.yml +52 -0
  65. data/spec/vcr/tv/top_rated.yml +84 -0
  66. data/themoviedb.gemspec +10 -35
  67. metadata +94 -9
@@ -1,98 +1,98 @@
1
- #encoding: utf-8
1
+ # encoding: utf-8
2
2
  require 'rspec'
3
3
  require 'spec_helper'
4
4
  require 'vcr'
5
5
 
6
6
  describe Tmdb::Person do
7
- @fields = [:id,:name,:place_of_birth,:also_known_as,
8
- :adult,:biography,:birthday,:deathday,:homepage,
9
- :profile_path,:movie_credits,:tv_credits,:combined_credits,
10
- :images,:changes]
7
+ @fields = [:id, :name, :place_of_birth, :also_known_as,
8
+ :adult, :biography, :birthday, :deathday, :homepage,
9
+ :profile_path, :movie_credits, :tv_credits, :combined_credits,
10
+ :images, :changes]
11
11
 
12
12
  @fields.each do |field|
13
13
  it { should respond_to field }
14
14
  end
15
15
 
16
- describe "For person p" do
16
+ describe 'For person p' do
17
17
  before(:each) do
18
18
  @person = Tmdb::Person
19
19
  end
20
20
 
21
- it "should return the popular people" do
21
+ it 'should return the popular people' do
22
22
  VCR.use_cassette 'person/popular' do
23
- @person.popular.should be_true
23
+ expect(@person.popular).to be_truthy
24
24
  end
25
25
  end
26
26
 
27
- it "should return the latest person" do
27
+ it 'should return the latest person' do
28
28
  VCR.use_cassette 'person/latest' do
29
- @person.latest.should be_true
29
+ expect(@person.latest).to be_truthy
30
30
  end
31
31
  end
32
32
 
33
- it "should return credits for a person ID" do
33
+ it 'should return credits for a person ID' do
34
34
  VCR.use_cassette 'person/credits' do
35
- @person.credits(5292).should be_true
35
+ expect(@person.credits(5292)).to be_truthy
36
36
  end
37
37
  end
38
38
 
39
- it "should return changes for a person ID" do
39
+ it 'should return changes for a person ID' do
40
40
  VCR.use_cassette 'person/changes' do
41
- @person.changes(5292).should be_true
41
+ expect(@person.changes(5292)).to be_truthy
42
42
  end
43
43
  end
44
44
  end
45
45
 
46
- describe "For a person detail" do
46
+ describe 'For a person detail' do
47
47
  before(:each) do
48
48
  VCR.use_cassette 'person/detail' do
49
49
  @person = Tmdb::Person.detail(5292)
50
50
  end
51
51
  end
52
52
 
53
- it "should return a id" do
54
- @person['id'].should == 5292
53
+ it 'should return a id' do
54
+ expect(@person['id']).to eq 5292
55
55
  end
56
56
 
57
- it "should return a name" do
58
- @person['name'].should == "Denzel Washington"
57
+ it 'should return a name' do
58
+ expect(@person['name']).to eq 'Denzel Washington'
59
59
  end
60
60
 
61
- it "should return a adult" do
62
- @person['adult'].should == false
61
+ it 'should return a adult' do
62
+ expect(@person['adult']).to eq false
63
63
  end
64
64
 
65
- it "should return a biography" do
66
- @person['biography'].should == "From Wikipedia, the free encyclopedia.\n\nDenzel Hayes Washington, Jr. (born December 28, 1954) is an American actor, screenwriter, director and film producer. He first rose to prominence when he joined the cast of the medical drama St. Elsewhere, playing Dr. Philip Chandler for six years. He has received much critical acclaim for his work in film since the 1990s, including for his portrayals of real-life figures, such as Steve Biko, Malcolm X, Rubin \"Hurricane\" Carter, Melvin B. Tolson, Frank Lucas, and Herman Boone.\n\nWashington has received two Academy Awards, two Golden Globe awards, a Tony Award. He is notable for winning the Best Supporting Actor for Glory in 1989; and the Academy Award for Best Actor in 2001 for his role in the film Training Day\n\nDescription above from the Wikipedia article Denzel Washington, licensed under CC-BY-SA, full list of contributors on Wikipedia."
65
+ it 'should return a biography' do
66
+ expect(@person['biography']).to eq "From Wikipedia, the free encyclopedia.\n\nDenzel Hayes Washington, Jr. (born December 28, 1954) is an American actor, screenwriter, director and film producer. He first rose to prominence when he joined the cast of the medical drama St. Elsewhere, playing Dr. Philip Chandler for six years. He has received much critical acclaim for his work in film since the 1990s, including for his portrayals of real-life figures, such as Steve Biko, Malcolm X, Rubin \"Hurricane\" Carter, Melvin B. Tolson, Frank Lucas, and Herman Boone.\n\nWashington has received two Academy Awards, two Golden Globe awards, a Tony Award. He is notable for winning the Best Supporting Actor for Glory in 1989; and the Academy Award for Best Actor in 2001 for his role in the film Training Day\n\nDescription above from the Wikipedia article Denzel Washington, licensed under CC-BY-SA, full list of contributors on Wikipedia."
67
67
  end
68
68
 
69
- it "should return a birthday" do
70
- @person['birthday'].should == "1954-12-28"
69
+ it 'should return a birthday' do
70
+ expect(@person['birthday']).to eq '1954-12-28'
71
71
  end
72
72
 
73
- it "should return a deathday" do
74
- @person['deathday'].should == ""
73
+ it 'should return a deathday' do
74
+ expect(@person['deathday']).to eq ''
75
75
  end
76
76
 
77
- it "should return a homepage" do
78
- @person['homepage'].should == ""
77
+ it 'should return a homepage' do
78
+ expect(@person['homepage']).to eq ''
79
79
  end
80
80
 
81
- it "should return a place of birth" do
82
- @person['place_of_birth'].should == "Mount Vernon, New York, USA"
81
+ it 'should return a place of birth' do
82
+ expect(@person['place_of_birth']).to eq 'Mount Vernon, New York, USA'
83
83
  end
84
84
 
85
- it "should return a profile path" do
86
- @person['profile_path'].should == "/khMf8LLTtppUwuZqqnigD2nAy26.jpg"
85
+ it 'should return a profile path' do
86
+ expect(@person['profile_path']).to eq '/khMf8LLTtppUwuZqqnigD2nAy26.jpg'
87
87
  end
88
88
 
89
- it "should return an array with also known as names" do
90
- @person['also_known_as'].should == []
89
+ it 'should return an array with also known as names' do
90
+ expect(@person['also_known_as']).to eq []
91
91
  end
92
92
  end
93
93
 
94
94
  describe 'For a person detail with appended response' do
95
- let(:append_fields) { %w{ movie_credits tv_credits combined_credits images changes }.join(',') }
95
+ let(:append_fields) { %w( movie_credits tv_credits combined_credits images changes ).join(',') }
96
96
 
97
97
  before(:each) do
98
98
  VCR.use_cassette 'person/detail_with_appended_response' do
@@ -101,44 +101,44 @@ describe Tmdb::Person do
101
101
  end
102
102
 
103
103
  it 'should return movie credits' do
104
- @person['movie_credits']['cast'].size.should == 47
105
- @person['movie_credits']['cast'].first['id'].should == 388
106
- @person['movie_credits']['crew'].size.should == 4
107
- @person['movie_credits']['crew'].first['id'].should == 13435
104
+ expect(@person['movie_credits']['cast'].size).to eq 47
105
+ expect(@person['movie_credits']['cast'].first['id']).to eq 388
106
+ expect(@person['movie_credits']['crew'].size).to eq 4
107
+ expect(@person['movie_credits']['crew'].first['id']).to eq 13_435
108
108
  end
109
109
 
110
110
  it 'should return tv credits' do
111
- @person['tv_credits']['cast'].size.should == 17
112
- @person['tv_credits']['cast'].first['id'].should == 1709
113
- @person['tv_credits']['crew'].size.should == 3
114
- @person['tv_credits']['crew'].first['id'].should == 18881
111
+ expect(@person['tv_credits']['cast'].size).to eq 17
112
+ expect(@person['tv_credits']['cast'].first['id']).to eq 1709
113
+ expect(@person['tv_credits']['crew'].size).to eq 3
114
+ expect(@person['tv_credits']['crew'].first['id']).to eq 18_881
115
115
  end
116
116
 
117
117
  it 'should return combined credits' do
118
- @person['combined_credits']['cast'].size.should == 64
119
- @person['combined_credits']['cast'].first['id'].should == 388
120
- @person['combined_credits']['crew'].size.should == 7
121
- @person['combined_credits']['crew'].first['id'].should == 13435
118
+ expect(@person['combined_credits']['cast'].size).to eq 64
119
+ expect(@person['combined_credits']['cast'].first['id']).to eq 388
120
+ expect(@person['combined_credits']['crew'].size).to eq 7
121
+ expect(@person['combined_credits']['crew'].first['id']).to eq 13_435
122
122
  end
123
123
 
124
124
  it 'should return images' do
125
- @person['images']['profiles'].size.should == 6
126
- @person['images']['profiles'].first['file_path'].should == '/khMf8LLTtppUwuZqqnigD2nAy26.jpg'
125
+ expect(@person['images']['profiles'].size).to eq 6
126
+ expect(@person['images']['profiles'].first['file_path']).to eq '/khMf8LLTtppUwuZqqnigD2nAy26.jpg'
127
127
  end
128
128
 
129
129
  it 'should return changes' do
130
- @person['changes']['changes'].should == []
130
+ expect(@person['changes']['changes']).to eq []
131
131
  end
132
132
  end
133
133
 
134
- describe "For images of a person" do
134
+ describe 'For images of a person' do
135
135
  before(:each) do
136
136
  VCR.use_cassette 'person/images' do
137
137
  @person_images = Tmdb::Person.images(5292)
138
138
  end
139
139
  end
140
140
 
141
- it "should return profiles" do
141
+ it 'should return profiles' do
142
142
  @person_images['profiles'].length == 6
143
143
  end
144
144
  end
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.themoviedb.org/3/find/tt1375666?external_source=tvdb_id
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ response:
15
+ status:
16
+ code: 401
17
+ message: Unauthorized
18
+ headers:
19
+ Access-Control-Allow-Origin:
20
+ - '*'
21
+ Content-Type:
22
+ - application/json;charset=utf-8
23
+ Date:
24
+ - Thu, 26 Dec 2013 20:09:42 GMT
25
+ Server:
26
+ - nginx
27
+ Status:
28
+ - 401 Unauthorized
29
+ Content-Length:
30
+ - '86'
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"status_code":7,"status_message":"Invalid API key - You must be granted
36
+ a valid key"}'
37
+ http_version:
38
+ recorded_at: Thu, 26 Dec 2013 20:09:41 GMT
39
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,29 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+
8
+ require_relative '../lib/themoviedb.rb'
9
+ require 'vcr'
10
+
11
+ Tmdb::Api.key('8a221fc31fcdf12a8af827465574ffc9')
12
+
13
+ VCR.configure do |c|
14
+ # the directory where your cassettes will be saved
15
+ c.cassette_library_dir = 'spec/vcr'
16
+ # your HTTP request service. You can also use fakeweb, webmock, and more
17
+ c.hook_into :webmock
18
+ end
19
+
20
+ RSpec.configure do |config|
21
+ config.run_all_when_everything_filtered = true
22
+ config.filter_run :focus
23
+
24
+ # Run specs in random order to surface order dependencies. If you find an
25
+ # order dependency and want to debug it, you can fix the order by providing
26
+ # the seed, which is printed after each run.
27
+ # --seed 1234
28
+ config.order = 'random'
29
+ end
@@ -3,160 +3,157 @@ require 'spec_helper'
3
3
  require 'vcr'
4
4
 
5
5
  describe Tmdb::TV do
6
-
7
6
  @fields = [
8
- :backdrop_path,
9
- :created_by,
10
- :episode_run_time,
11
- :first_air_date,
12
- :genres,
13
- :homepage,
14
- :id,
15
- :in_production,
16
- :languages,
17
- :last_air_date,
18
- :name,
19
- :networks,
20
- :number_of_episodes,
21
- :number_of_seasons,
22
- :original_name,
23
- :origin_country,
24
- :overview,
25
- :popularity,
26
- :poster_path,
27
- :seasons,
28
- :status,
29
- :vote_average,
30
- :vote_count,
31
- :credits,
32
- :external_ids
33
- ]
7
+ :backdrop_path,
8
+ :created_by,
9
+ :episode_run_time,
10
+ :first_air_date,
11
+ :genres,
12
+ :homepage,
13
+ :id,
14
+ :in_production,
15
+ :languages,
16
+ :last_air_date,
17
+ :name,
18
+ :networks,
19
+ :number_of_episodes,
20
+ :number_of_seasons,
21
+ :original_name,
22
+ :origin_country,
23
+ :overview,
24
+ :popularity,
25
+ :poster_path,
26
+ :seasons,
27
+ :status,
28
+ :vote_average,
29
+ :vote_count,
30
+ :credits,
31
+ :external_ids
32
+ ]
34
33
 
35
34
  @fields.each do |field|
36
35
  it { should respond_to field }
37
36
  end
38
37
 
39
- describe "For Chuck it should return images" do
38
+ describe 'For Chuck it should return images' do
40
39
  before(:each) do
41
40
  VCR.use_cassette 'tv/test_chuck' do
42
41
  @tv = Tmdb::TV.images(1404)
43
42
  end
44
43
  end
45
44
 
46
- it "should return backdrops for chuck" do
47
- @tv['backdrops'].length.should >= 1
45
+ it 'should return backdrops for chuck' do
46
+ expect(@tv['backdrops'].length).to be >= 1
48
47
  end
49
48
 
50
- it "should return posters for chuck" do
51
- @tv['posters'].length.should >= 1
49
+ it 'should return posters for chuck' do
50
+ expect(@tv['posters'].length).to be >= 1
52
51
  end
53
52
  end
54
53
 
55
- describe "For a TV detail" do
56
-
54
+ describe 'For a TV detail' do
57
55
  before(:each) do
58
56
  VCR.use_cassette 'tv/detail' do
59
57
  @tv = Tmdb::TV.detail(1396)
60
58
  end
61
59
  end
62
60
 
63
- it "should return a id" do
64
- @tv['id'].should == 1396
61
+ it 'should return a id' do
62
+ expect(@tv['id']).to eq 1396
65
63
  end
66
64
 
67
- it "should return a backdrop" do
68
- @tv['backdrop_path'].should == "/8STVFl9kvWtFAydXUFHIUvT47AA.jpg"
65
+ it 'should return a backdrop' do
66
+ expect(@tv['backdrop_path']).to eq '/8STVFl9kvWtFAydXUFHIUvT47AA.jpg'
69
67
  end
70
68
 
71
- it "should return a created date" do
72
- @tv['created_by'].first['name'].should == "Vince Gilligan"
69
+ it 'should return a created date' do
70
+ expect(@tv['created_by'].first['name']).to eq 'Vince Gilligan'
73
71
  end
74
72
 
75
- it "should return a run time" do
76
- @tv['episode_run_time'].should == [45, 47]
73
+ it 'should return a run time' do
74
+ expect(@tv['episode_run_time']).to eq [45, 47]
77
75
  end
78
76
 
79
- it "should return genres" do
80
- @tv['genres'].should_not == []
77
+ it 'should return genres' do
78
+ expect(@tv['genres']).not_to eq []
81
79
  end
82
80
 
83
- it "should return a first air date" do
84
- @tv['first_air_date'].should == "2008-01-20"
81
+ it 'should return a first air date' do
82
+ expect(@tv['first_air_date']).to eq '2008-01-20'
85
83
  end
86
84
 
87
- it "should return a homepage" do
88
- @tv['homepage'].should == "http://www.amctv.com/shows/breaking-bad"
85
+ it 'should return a homepage' do
86
+ expect(@tv['homepage']).to eq 'http://www.amctv.com/shows/breaking-bad'
89
87
  end
90
88
 
91
- it "should return a production state" do
92
- @tv['in_production'].should be_false
89
+ it 'should return a production state' do
90
+ expect(@tv['in_production']).to be_falsey
93
91
  end
94
92
 
95
- it "should return languages" do
96
- @tv['languages'].should == ["en", "de", "ro", "es", "fa"]
93
+ it 'should return languages' do
94
+ expect(@tv['languages']).to eq %w(en de ro es fa)
97
95
  end
98
96
 
99
- it "should return a last air date" do
100
- @tv['last_air_date'].should == "2013-09-29"
97
+ it 'should return a last air date' do
98
+ expect(@tv['last_air_date']).to eq '2013-09-29'
101
99
  end
102
100
 
103
- it "should return a name" do
104
- @tv['name'].should == "Breaking Bad"
101
+ it 'should return a name' do
102
+ expect(@tv['name']).to eq 'Breaking Bad'
105
103
  end
106
104
 
107
- it "should return a network" do
108
- @tv['networks'].first['id'].should == 174
109
- @tv['networks'].first['name'] == "AMC"
105
+ it 'should return a network' do
106
+ expect(@tv['networks'].first['id']).to eq 174
107
+ @tv['networks'].first['name'] == 'AMC'
110
108
  end
111
109
 
112
- it "should return the number of episodes" do
113
- @tv['number_of_episodes'].should == 62
110
+ it 'should return the number of episodes' do
111
+ expect(@tv['number_of_episodes']).to eq 62
114
112
  end
115
113
 
116
- it "should return the number of seasons" do
117
- @tv['number_of_seasons'].should == 5
114
+ it 'should return the number of seasons' do
115
+ expect(@tv['number_of_seasons']).to eq 5
118
116
  end
119
117
 
120
- it "should return the original name" do
121
- @tv['original_name'].should == "Breaking Bad"
118
+ it 'should return the original name' do
119
+ expect(@tv['original_name']).to eq 'Breaking Bad'
122
120
  end
123
121
 
124
- it "should return the origin country" do
125
- @tv['origin_country'].should == ["US"]
122
+ it 'should return the origin country' do
123
+ expect(@tv['origin_country']).to eq ['US']
126
124
  end
127
125
 
128
- it "should return a overview" do
129
- @tv['overview'].should == "Breaking Bad is an American crime drama television series created and produced by Vince Gilligan. Set and produced in Albuquerque, New Mexico, Breaking Bad is the story of Walter White, a struggling high school chemistry teacher who is diagnosed with inoperable lung cancer at the beginning of the series. He turns to a life of crime, producing and selling methamphetamine, in order to secure his family's financial future before he dies, teaming with his former student, Jesse Pinkman. Heavily serialized, the series is known for positioning its characters in seemingly inextricable corners and has been labeled a contemporary western by its creator."
126
+ it 'should return a overview' do
127
+ expect(@tv['overview']).to eq "Breaking Bad is an American crime drama television series created and produced by Vince Gilligan. Set and produced in Albuquerque, New Mexico, Breaking Bad is the story of Walter White, a struggling high school chemistry teacher who is diagnosed with inoperable lung cancer at the beginning of the series. He turns to a life of crime, producing and selling methamphetamine, in order to secure his family's financial future before he dies, teaming with his former student, Jesse Pinkman. Heavily serialized, the series is known for positioning its characters in seemingly inextricable corners and has been labeled a contemporary western by its creator."
130
128
  end
131
129
 
132
- it "should return a popularity rating" do
133
- @tv['popularity'].should == 6.60821276854239
130
+ it 'should return a popularity rating' do
131
+ expect(@tv['popularity']).to eq 6.60821276854239
134
132
  end
135
133
 
136
- it "should return a poster" do
137
- @tv['poster_path'].should == "/iRDNn9EHKuBhGa77UBteazvsZa1.jpg"
134
+ it 'should return a poster' do
135
+ expect(@tv['poster_path']).to eq '/iRDNn9EHKuBhGa77UBteazvsZa1.jpg'
138
136
  end
139
137
 
140
- it "should return seasons" do
141
- @tv['seasons'].should_not == []
138
+ it 'should return seasons' do
139
+ expect(@tv['seasons']).not_to eq []
142
140
  end
143
141
 
144
- it "should return a status" do
145
- @tv['status'].should == "Ended"
142
+ it 'should return a status' do
143
+ expect(@tv['status']).to eq 'Ended'
146
144
  end
147
145
 
148
- it "should return a vote average" do
149
- @tv['vote_average'].should == 8.86764705882353
146
+ it 'should return a vote average' do
147
+ expect(@tv['vote_average']).to eq 8.86764705882353
150
148
  end
151
149
 
152
- it "should return a vote count" do
153
- @tv['vote_count'].should == 34
150
+ it 'should return a vote count' do
151
+ expect(@tv['vote_count']).to eq 34
154
152
  end
155
-
156
153
  end
157
154
 
158
- describe "For a TV detail with appended response" do
159
- let(:append_fields) { %w{ credits external_ids }.join(',') }
155
+ describe 'For a TV detail with appended response' do
156
+ let(:append_fields) { %w( credits external_ids ).join(',') }
160
157
 
161
158
  before(:each) do
162
159
  VCR.use_cassette 'tv/detail_with_appeded_response' do
@@ -165,294 +162,276 @@ describe Tmdb::TV do
165
162
  end
166
163
 
167
164
  it 'should return credits' do
168
- @tv['credits']['cast'].size.should == 7
169
- @tv['credits']['cast'].first['id'].should == 17419
170
- @tv['credits']['crew'].size.should == 4
171
- @tv['credits']['crew'].first['id'].should == 5162
165
+ expect(@tv['credits']['cast'].size).to eq 7
166
+ expect(@tv['credits']['cast'].first['id']).to eq 17_419
167
+ expect(@tv['credits']['crew'].size).to eq 4
168
+ expect(@tv['credits']['crew'].first['id']).to eq 5162
172
169
  end
173
170
 
174
171
  it 'should return external_ids' do
175
- @tv['external_ids']['imdb_id'].should == 'tt0903747'
172
+ expect(@tv['external_ids']['imdb_id']).to eq 'tt0903747'
176
173
  end
177
174
  end
178
175
 
179
- describe "For popular TV shows" do
180
-
176
+ describe 'For popular TV shows' do
181
177
  before(:each) do
182
178
  VCR.use_cassette 'tv/popular' do
183
179
  @tv = Tmdb::TV.popular
184
180
  end
185
181
  end
186
182
 
187
- it "should return an array" do
188
- @tv.class.should == Array
183
+ it 'should return an array' do
184
+ expect(@tv.class).to eq Array
189
185
  end
190
186
 
191
- it "each show should return an id" do
192
- @tv.first['id'].should == 57243
187
+ it 'each show should return an id' do
188
+ expect(@tv.first.id).to eq 57_243
193
189
  end
194
190
 
195
- it "each show should return an name" do
196
- @tv.first['name'].should == "Doctor Who"
191
+ it 'each show should return an name' do
192
+ expect(@tv.first.name).to eq 'Doctor Who'
197
193
  end
198
194
 
199
- it "each show should return an original name" do
200
- @tv.first['original_name'].should == "Doctor Who"
195
+ it 'each show should return an original name' do
196
+ expect(@tv.first.original_name).to eq 'Doctor Who'
201
197
  end
202
198
 
203
- it "each show should return an popularity" do
204
- @tv.first['popularity'].should == 16.5167252220739
199
+ it 'each show should return an popularity' do
200
+ expect(@tv.first.popularity).to eq 16.5167252220739
205
201
  end
206
202
 
207
- it "each show should return an poster_path" do
208
- @tv.first['poster_path'].should == "/4a94ptIdYz0JwSzo0dCNuPCcfM8.jpg"
203
+ it 'each show should return an poster_path' do
204
+ expect(@tv.first.poster_path).to eq '/4a94ptIdYz0JwSzo0dCNuPCcfM8.jpg'
209
205
  end
210
206
 
211
- it "each show should return an vote_average" do
212
- @tv.first['vote_average'].should == 7.875
207
+ it 'each show should return an vote_average' do
208
+ expect(@tv.first.vote_average).to eq 7.875
213
209
  end
214
210
 
215
- it "each show should return an vote_count" do
216
- @tv.first['vote_count'].should == 4
211
+ it 'each show should return an vote_count' do
212
+ expect(@tv.first.vote_count).to eq 4
217
213
  end
218
214
 
219
- it "each show should return an backdrop" do
220
- @tv.first['backdrop_path'].should == nil
215
+ it 'each show should return an backdrop' do
216
+ expect(@tv.first.backdrop_path).to eq nil
221
217
  end
222
218
 
223
- it "each show should return an first air date" do
224
- @tv.first['first_air_date'].should == "2005-03-26"
219
+ it 'each show should return an first air date' do
220
+ expect(@tv.first.first_air_date).to eq '2005-03-26'
225
221
  end
226
-
227
222
  end
228
223
 
229
- describe "For top rated TV shows" do
230
-
224
+ describe 'For top rated TV shows' do
231
225
  before(:each) do
232
226
  VCR.use_cassette 'tv/top_rated' do
233
227
  @tv = Tmdb::TV.top_rated
234
228
  end
235
229
  end
236
230
 
237
- it "should return an array" do
238
- @tv.class.should == Array
231
+ it 'should return an array' do
232
+ expect(@tv.class).to eq Array
239
233
  end
240
234
 
241
- it "each show should return an id" do
242
- @tv.first['id'].should == 1104
235
+ it 'each show should return an id' do
236
+ expect(@tv.first.id).to eq 1104
243
237
  end
244
238
 
245
- it "each show should return an name" do
246
- @tv.first['name'].should == "Mad Men"
239
+ it 'each show should return an name' do
240
+ expect(@tv.first.name).to eq 'Mad Men'
247
241
  end
248
242
 
249
- it "each show should return an original name" do
250
- @tv.first['original_name'].should == "Mad Men"
243
+ it 'each show should return an original name' do
244
+ expect(@tv.first.original_name).to eq 'Mad Men'
251
245
  end
252
246
 
253
- it "each show should return an popularity" do
254
- @tv.first['popularity'].should == 2.15615937122719
247
+ it 'each show should return an popularity' do
248
+ expect(@tv.first.popularity).to eq 2.15615937122719
255
249
  end
256
250
 
257
- it "each show should return an poster_path" do
258
- @tv.first['poster_path'].should == "/xA2nHrx2oHGPnL4ehBwPxD0ABvb.jpg"
251
+ it 'each show should return an poster_path' do
252
+ expect(@tv.first.poster_path).to eq '/xA2nHrx2oHGPnL4ehBwPxD0ABvb.jpg'
259
253
  end
260
254
 
261
- it "each show should return an vote_average" do
262
- @tv.first['vote_average'].should == 9.66666666666667
255
+ it 'each show should return an vote_average' do
256
+ expect(@tv.first.vote_average).to eq 9.66666666666667
263
257
  end
264
258
 
265
- it "each show should return an vote_count" do
266
- @tv.first['vote_count'].should == 3
259
+ it 'each show should return an vote_count' do
260
+ expect(@tv.first.vote_count).to eq 3
267
261
  end
268
262
 
269
- it "each show should return an backdrop" do
270
- @tv.first['backdrop_path'].should == "/yGW0NX3I8GXPlWPdoWWyaH0AsCk.jpg"
263
+ it 'each show should return an backdrop' do
264
+ expect(@tv.first.backdrop_path).to eq '/yGW0NX3I8GXPlWPdoWWyaH0AsCk.jpg'
271
265
  end
272
266
 
273
- it "each show should return an first air date" do
274
- @tv.first['first_air_date'].should == "2007-07-19"
267
+ it 'each show should return an first air date' do
268
+ expect(@tv.first.first_air_date).to eq '2007-07-19'
275
269
  end
276
-
277
270
  end
278
271
 
279
- describe "For a TV shows images" do
280
-
281
- describe "For backdrops" do
282
-
272
+ describe 'For a TV shows images' do
273
+ describe 'For backdrops' do
283
274
  before(:each) do
284
275
  VCR.use_cassette 'tv/images' do
285
276
  @backdrop = Tmdb::TV.images(1396)['backdrops'].first
286
277
  end
287
278
  end
288
279
 
289
- it "should return a aspect ratio" do
290
- @backdrop['aspect_ratio'].should == 1.78
280
+ it 'should return a aspect ratio' do
281
+ expect(@backdrop['aspect_ratio']).to eq 1.78
291
282
  end
292
283
 
293
- it "should return a file path" do
294
- @backdrop['file_path'].should == "/dRaV8HGx7Z9xmw77qSs8prp5OuI.jpg"
284
+ it 'should return a file path' do
285
+ expect(@backdrop['file_path']).to eq '/dRaV8HGx7Z9xmw77qSs8prp5OuI.jpg'
295
286
  end
296
287
 
297
- it "should return a height" do
298
- @backdrop['height'].should == 720
288
+ it 'should return a height' do
289
+ expect(@backdrop['height']).to eq 720
299
290
  end
300
291
 
301
- it "should return a iso code" do
302
- @backdrop['iso_639_1'].should == nil
292
+ it 'should return a iso code' do
293
+ expect(@backdrop['iso_639_1']).to eq nil
303
294
  end
304
295
 
305
- it "should return a vote average" do
306
- @backdrop['vote_average'].should == 0.0
296
+ it 'should return a vote average' do
297
+ expect(@backdrop['vote_average']).to eq 0.0
307
298
  end
308
299
 
309
- it "should return a vote count" do
310
- @backdrop['vote_count'].should == 0.0
300
+ it 'should return a vote count' do
301
+ expect(@backdrop['vote_count']).to eq 0.0
311
302
  end
312
303
 
313
- it "should return a width" do
314
- @backdrop['width'].should == 1280
304
+ it 'should return a width' do
305
+ expect(@backdrop['width']).to eq 1280
315
306
  end
316
-
317
307
  end
318
308
 
319
- describe "For posters" do
320
-
309
+ describe 'For posters' do
321
310
  before(:each) do
322
311
  VCR.use_cassette 'tv/images' do
323
312
  @poster = Tmdb::TV.images(1396)['posters'].first
324
313
  end
325
314
  end
326
315
 
327
- it "should return a aspect ratio" do
328
- @poster['aspect_ratio'].should == 1.0
316
+ it 'should return a aspect ratio' do
317
+ expect(@poster['aspect_ratio']).to eq 1.0
329
318
  end
330
319
 
331
- it "should return a file path" do
332
- @poster['file_path'].should == "/lVbofIPlw3kYa8FQgHT7GtWMI2Q.jpg"
320
+ it 'should return a file path' do
321
+ expect(@poster['file_path']).to eq '/lVbofIPlw3kYa8FQgHT7GtWMI2Q.jpg'
333
322
  end
334
323
 
335
- it "should return a height" do
336
- @poster['height'].should == 1000
324
+ it 'should return a height' do
325
+ expect(@poster['height']).to eq 1000
337
326
  end
338
327
 
339
- it "should return a iso code" do
340
- @poster['iso_639_1'].should == "nl"
328
+ it 'should return a iso code' do
329
+ expect(@poster['iso_639_1']).to eq 'nl'
341
330
  end
342
331
 
343
- it "should return a vote average" do
344
- @poster['vote_average'].should == 5.3125
332
+ it 'should return a vote average' do
333
+ expect(@poster['vote_average']).to eq 5.3125
345
334
  end
346
335
 
347
- it "should return a vote count" do
348
- @poster['vote_count'].should == 1
336
+ it 'should return a vote count' do
337
+ expect(@poster['vote_count']).to eq 1
349
338
  end
350
339
 
351
- it "should return a width" do
352
- @poster['width'].should == 1000
340
+ it 'should return a width' do
341
+ expect(@poster['width']).to eq 1000
353
342
  end
354
-
355
343
  end
356
-
357
344
  end
358
345
 
359
- describe "For a TV shows cast" do
360
-
346
+ describe 'For a TV shows cast' do
361
347
  before(:each) do
362
348
  VCR.use_cassette 'tv/cast' do
363
349
  @cast = Tmdb::TV.cast(1396).first
364
350
  end
365
351
  end
366
352
 
367
- it "should return a id" do
368
- @cast['id'].should == 17419
353
+ it 'should return a id' do
354
+ expect(@cast['id']).to eq 17_419
369
355
  end
370
356
 
371
- it "should return a name" do
372
- @cast['name'].should == "Bryan Cranston"
357
+ it 'should return a name' do
358
+ expect(@cast['name']).to eq 'Bryan Cranston'
373
359
  end
374
360
 
375
- it "should return a order" do
376
- @cast['order'].should == 0
361
+ it 'should return a order' do
362
+ expect(@cast['order']).to eq 0
377
363
  end
378
364
 
379
- it "should return a profile image" do
380
- @cast['profile_path'].should == "/qXWgFCk4OJqmLRUBEj7cbp8dnkx.jpg"
365
+ it 'should return a profile image' do
366
+ expect(@cast['profile_path']).to eq '/qXWgFCk4OJqmLRUBEj7cbp8dnkx.jpg'
381
367
  end
382
368
 
383
- it "should return a character name" do
384
- @cast['character'].should == "Walter White"
369
+ it 'should return a character name' do
370
+ expect(@cast['character']).to eq 'Walter White'
385
371
  end
386
372
 
387
- it "should return a credit id" do
388
- @cast['credit_id'].should == "52542282760ee313280017f9"
373
+ it 'should return a credit id' do
374
+ expect(@cast['credit_id']).to eq '52542282760ee313280017f9'
389
375
  end
390
-
391
376
  end
392
377
 
393
- describe "For a TV shows crew" do
394
-
378
+ describe 'For a TV shows crew' do
395
379
  before(:each) do
396
380
  VCR.use_cassette 'tv/crew' do
397
381
  @crew = Tmdb::TV.crew(1396).first
398
382
  end
399
383
  end
400
384
 
401
- it "should return a id" do
402
- @crew['id'].should == 29779
385
+ it 'should return a id' do
386
+ expect(@crew['id']).to eq 29_779
403
387
  end
404
388
 
405
- it "should return a department" do
406
- @crew['department'].should == "Production"
389
+ it 'should return a department' do
390
+ expect(@crew['department']).to eq 'Production'
407
391
  end
408
392
 
409
- it "should return a job" do
410
- @crew['job'].should == "Executive Producer"
393
+ it 'should return a job' do
394
+ expect(@crew['job']).to eq 'Executive Producer'
411
395
  end
412
396
 
413
- it "should return a name" do
414
- @crew['name'].should == "Michelle MacLaren"
397
+ it 'should return a name' do
398
+ expect(@crew['name']).to eq 'Michelle MacLaren'
415
399
  end
416
400
 
417
- it "should return a profile image" do
418
- @crew['profile_path'].should == nil
401
+ it 'should return a profile image' do
402
+ expect(@crew['profile_path']).to eq nil
419
403
  end
420
-
421
404
  end
422
405
 
423
- describe "For a TV shows external ids" do
424
-
406
+ describe 'For a TV shows external ids' do
425
407
  before(:each) do
426
408
  VCR.use_cassette 'tv/external_ids' do
427
409
  @external = Tmdb::TV.external_ids(1396)
428
410
  end
429
411
  end
430
412
 
431
- it "should return a id" do
432
- @external['id'].should == 1396
413
+ it 'should return a id' do
414
+ expect(@external['id']).to eq 1396
433
415
  end
434
416
 
435
- it "should return a imdb id" do
436
- @external['imdb_id'].should == "tt0903747"
417
+ it 'should return a imdb id' do
418
+ expect(@external['imdb_id']).to eq 'tt0903747'
437
419
  end
438
420
 
439
- it "should return a tvdb id" do
440
- @external['tvdb_id'].should == 81189
421
+ it 'should return a tvdb id' do
422
+ expect(@external['tvdb_id']).to eq 81_189
441
423
  end
442
424
 
443
- it "should return a tvrage id" do
444
- @external['tvrage_id'].should == 18164
425
+ it 'should return a tvrage id' do
426
+ expect(@external['tvrage_id']).to eq 18_164
445
427
  end
446
428
 
447
- it "should return a freebase id" do
448
- @external['freebase_id'].should == "/en/breaking_bad"
429
+ it 'should return a freebase id' do
430
+ expect(@external['freebase_id']).to eq '/en/breaking_bad'
449
431
  end
450
432
 
451
- it "should return a freebase mid" do
452
- @external['freebase_mid'].should == "/m/03d34x8"
433
+ it 'should return a freebase mid' do
434
+ expect(@external['freebase_mid']).to eq '/m/03d34x8'
453
435
  end
454
-
455
-
456
436
  end
457
-
458
437
  end