thetvdb_mapper 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/README.md +5 -14
  4. data/lib/thetvdb_mapper.rb +4 -10
  5. data/lib/thetvdb_mapper/actor.rb +7 -0
  6. data/lib/thetvdb_mapper/banner.rb +14 -0
  7. data/lib/thetvdb_mapper/base.rb +3 -9
  8. data/lib/thetvdb_mapper/episode.rb +32 -11
  9. data/lib/thetvdb_mapper/series.rb +25 -11
  10. data/lib/thetvdb_mapper/version.rb +1 -1
  11. data/spec/functionals/actor_spec.rb +34 -0
  12. data/spec/functionals/banner_spec.rb +49 -0
  13. data/spec/functionals/episode_spec.rb +88 -0
  14. data/spec/functionals/series_spec.rb +72 -0
  15. data/thetvdb_mapper.gemspec +2 -1
  16. metadata +29 -65
  17. data/lib/thetvdb_mapper/actors.rb +0 -17
  18. data/lib/thetvdb_mapper/banners.rb +0 -17
  19. data/lib/thetvdb_mapper/fetcher.rb +0 -25
  20. data/lib/thetvdb_mapper/full_series.rb +0 -53
  21. data/lib/thetvdb_mapper/mapping/actor.rb +0 -11
  22. data/lib/thetvdb_mapper/mapping/banner.rb +0 -18
  23. data/lib/thetvdb_mapper/mapping/base.rb +0 -27
  24. data/lib/thetvdb_mapper/mapping/episode.rb +0 -45
  25. data/lib/thetvdb_mapper/mapping/series.rb +0 -36
  26. data/lib/thetvdb_mapper/mapping/string_list.rb +0 -5
  27. data/spec/functionals/mapping/actor_spec.rb +0 -36
  28. data/spec/functionals/mapping/banner_spec.rb +0 -72
  29. data/spec/functionals/mapping/episode_spec.rb +0 -165
  30. data/spec/functionals/mapping/series_spec.rb +0 -128
  31. data/spec/integrations/classes/actors_spec.rb +0 -11
  32. data/spec/integrations/classes/banners_spec.rb +0 -11
  33. data/spec/integrations/classes/episode_spec.rb +0 -11
  34. data/spec/integrations/classes/fetcher_spec.rb +0 -35
  35. data/spec/integrations/classes/full_series_spec.rb +0 -11
  36. data/spec/integrations/classes/series_spec.rb +0 -11
  37. data/spec/integrations/integration_spec_helper.rb +0 -2
  38. data/spec/integrations/support/.keep +0 -0
  39. data/spec/units/actors_spec.rb +0 -40
  40. data/spec/units/banners_spec.rb +0 -40
  41. data/spec/units/base_spec.rb +0 -15
  42. data/spec/units/episode_spec.rb +0 -33
  43. data/spec/units/fetcher_spec.rb +0 -67
  44. data/spec/units/full_series_spec.rb +0 -140
  45. data/spec/units/mapping/actor_spec.rb +0 -27
  46. data/spec/units/mapping/banner_spec.rb +0 -54
  47. data/spec/units/mapping/base_spec.rb +0 -36
  48. data/spec/units/mapping/episode_spec.rb +0 -142
  49. data/spec/units/mapping/series_spec.rb +0 -114
  50. data/spec/units/mapping/string_list_spec.rb +0 -11
  51. data/spec/units/series_spec.rb +0 -33
@@ -1,72 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbMapper::Mapping::Banner do
4
- let(:model) { ThetvdbMapper::Mapping::Banner.new({}) }
5
-
6
- describe '#map' do
7
- it 'should return specific keys' do
8
- model.map.keys.sort.should == [:path, :thumbnail_path, :vignette_path, :kind, :kind2, :language, :season,
9
- :rating, :rating_count, :series_name, :colors, :id].sort
10
- end
11
-
12
- it 'should map id' do
13
- model.stub(:data).and_return('id' => '1')
14
- model.map[:id].should == '1'
15
- end
16
-
17
- it 'should map BannerPath' do
18
- model.stub(:data).and_return('BannerPath' => 'test')
19
- model.map[:path].should == 'test'
20
- end
21
-
22
- it 'should map ThumbnailPath' do
23
- model.stub(:data).and_return('ThumbnailPath' => 'test')
24
- model.map[:thumbnail_path].should == 'test'
25
- end
26
-
27
- it 'should map VignettePath' do
28
- model.stub(:data).and_return('VignettePath' => 'test')
29
- model.map[:vignette_path].should == 'test'
30
- end
31
-
32
- it 'should map BannerType' do
33
- model.stub(:data).and_return('BannerType' => 'test')
34
- model.map[:kind].should == 'test'
35
- end
36
-
37
- it 'should map BannerType2' do
38
- model.stub(:data).and_return('BannerType2' => 'test')
39
- model.map[:kind2].should == 'test'
40
- end
41
-
42
- it 'should map Language' do
43
- model.stub(:data).and_return('Language' => 'test')
44
- model.map[:language].should == 'test'
45
- end
46
-
47
- it 'should map Season' do
48
- model.stub(:data).and_return('Season' => 'test')
49
- model.map[:season].should == 'test'
50
- end
51
-
52
- it 'should map Rating' do
53
- model.stub(:data).and_return('Rating' => 'test')
54
- model.map[:rating].should == 'test'
55
- end
56
-
57
- it 'should map RatingCount' do
58
- model.stub(:data).and_return('RatingCount' => 'test')
59
- model.map[:rating_count].should == 'test'
60
- end
61
-
62
- it 'should map SeriesName' do
63
- model.stub(:data).and_return('SeriesName' => 'test')
64
- model.map[:series_name].should == 'test'
65
- end
66
-
67
- it 'should map Colors' do
68
- model.stub(:data).and_return('Colors' => 'test')
69
- model.map[:colors].should == 'test'
70
- end
71
- end
72
- end
@@ -1,165 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbMapper::Mapping::Episode do
4
- let(:model) { ThetvdbMapper::Mapping::Episode.new({}) }
5
-
6
- describe '#map' do
7
- it 'should return specific keys' do
8
- model.map.keys.sort.should == [:id, :combined_episode_number, :combined_season, :dvd_episode_number,
9
- :dvd_season, :director, :ep_img_flag, :name, :number, :first_aired, :guest_stars, :imdb_id, :language,
10
- :overview, :production_code, :rating, :rating_count, :season, :writer, :absolute_number, :airs_after_season,
11
- :airs_before_episode, :airs_before_season, :filename_path, :last_updated_at, :season_id, :series_id,
12
- :thumbnail_added_at, :thumbnail_height, :thumbnail_width].sort
13
- end
14
-
15
- it 'should map id' do
16
- model.stub(:data).and_return('id' => 1234)
17
- model.map[:id].should == 1234
18
- end
19
-
20
- it 'should map Combined_episodenumber' do
21
- model.stub(:data).and_return('Combined_episodenumber' => 1234)
22
- model.map[:combined_episode_number].should == 1234
23
- end
24
-
25
- it 'should map Combined_season' do
26
- model.stub(:data).and_return('Combined_season' => 1234)
27
- model.map[:combined_season].should == 1234
28
- end
29
-
30
- it 'should map DVD_episodenumber' do
31
- model.stub(:data).and_return('DVD_episodenumber' => 1234)
32
- model.map[:dvd_episode_number].should == 1234
33
- end
34
-
35
- it 'should map DVD_season' do
36
- model.stub(:data).and_return('DVD_season' => 1234)
37
- model.map[:dvd_season].should == 1234
38
- end
39
-
40
- it 'should map Director' do
41
- model.stub(:data).and_return('Director' => '|test|')
42
- model.map[:director].should == ['test']
43
- end
44
-
45
- it 'should map EpImgFlag' do
46
- model.stub(:data).and_return('EpImgFlag' => 1234)
47
- model.map[:ep_img_flag].should == 1234
48
- end
49
-
50
- it 'should map EpisodeName' do
51
- model.stub(:data).and_return('EpisodeName' => 'test')
52
- model.map[:name].should == 'test'
53
- end
54
-
55
- it 'should map EpisodeNumber' do
56
- model.stub(:data).and_return('EpisodeNumber' => 1234)
57
- model.map[:number].should == 1234
58
- end
59
-
60
- it 'should map FirstAired' do
61
- model.stub(:data).and_return('FirstAired' => 1234)
62
- model.map[:first_aired].should == 1234
63
- end
64
-
65
- it 'should map GuestStars' do
66
- model.stub(:data).and_return('GuestStars' => '|test|')
67
- model.map[:guest_stars].should == ['test']
68
- end
69
-
70
- it 'should map IMDB_ID' do
71
- model.stub(:data).and_return('IMDB_ID' => 'test')
72
- model.map[:imdb_id].should == 'test'
73
- end
74
-
75
- it 'should map Language' do
76
- model.stub(:data).and_return('Language' => 'test')
77
- model.map[:language].should == 'test'
78
- end
79
-
80
- it 'should map Overview' do
81
- model.stub(:data).and_return('Overview' => 'test')
82
- model.map[:overview].should == 'test'
83
- end
84
-
85
- it 'should map ProductionCode' do
86
- model.stub(:data).and_return('ProductionCode' => 'test')
87
- model.map[:production_code].should == 'test'
88
- end
89
-
90
- it 'should map Rating' do
91
- model.stub(:data).and_return('Rating' => '1.0')
92
- model.map[:rating].should == '1.0'
93
- end
94
-
95
- it 'should map RatingCount' do
96
- model.stub(:data).and_return('RatingCount' => '1')
97
- model.map[:rating_count].should == '1'
98
- end
99
-
100
- it 'should map SeasonNumber' do
101
- model.stub(:data).and_return('SeasonNumber' => '1')
102
- model.map[:season].should == '1'
103
- end
104
-
105
- it 'should map Writer' do
106
- model.stub(:data).and_return('Writer' => '|test|')
107
- model.map[:writer].should == ['test']
108
- end
109
-
110
- it 'should map absolute_number' do
111
- model.stub(:data).and_return('absolute_number' => '1')
112
- model.map[:absolute_number].should == '1'
113
- end
114
-
115
- it 'should map airsafter_season' do
116
- model.stub(:data).and_return('airsafter_season' => '1')
117
- model.map[:airs_after_season].should == '1'
118
- end
119
-
120
- it 'should map airsbefore_episode' do
121
- model.stub(:data).and_return('airsbefore_episode' => '1')
122
- model.map[:airs_before_episode].should == '1'
123
- end
124
-
125
- it 'should map airsbefore_season' do
126
- model.stub(:data).and_return('airsbefore_season' => '1')
127
- model.map[:airs_before_season].should == '1'
128
- end
129
-
130
- it 'should map filename' do
131
- model.stub(:data).and_return('filename' => 'test')
132
- model.map[:filename_path].should == 'test'
133
- end
134
-
135
- it 'should map lastupdated' do
136
- model.stub(:data).and_return('lastupdated' => '1234')
137
- model.map[:last_updated_at].should == Time.at(1234)
138
- end
139
-
140
- it 'should map seasonid' do
141
- model.stub(:data).and_return('seasonid' => '1')
142
- model.map[:season_id].should == '1'
143
- end
144
-
145
- it 'should map seriesid' do
146
- model.stub(:data).and_return('seriesid' => '1')
147
- model.map[:series_id].should == '1'
148
- end
149
-
150
- it 'should map thumb_added' do
151
- model.stub(:data).and_return('thumb_added' => 'test')
152
- model.map[:thumbnail_added_at].should == 'test'
153
- end
154
-
155
- it 'should map thumb_height' do
156
- model.stub(:data).and_return('thumb_height' => 'test')
157
- model.map[:thumbnail_height].should == 'test'
158
- end
159
-
160
- it 'should map thumb_width' do
161
- model.stub(:data).and_return('thumb_width' => 'test')
162
- model.map[:thumbnail_width].should == 'test'
163
- end
164
- end
165
- end
@@ -1,128 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbMapper::Mapping::Series do
4
- let(:model) { ThetvdbMapper::Mapping::Series.new({}) }
5
-
6
- describe '#map' do
7
- it 'should return specific keys' do
8
- model.map.keys.sort.should == [:id, :airs_day_of_week, :airs_time, :content_rating, :first_aired, :genres,
9
- :imdb_id, :language, :network, :network_id, :overview, :rating, :rating_count, :runtime, :name, :status,
10
- :added_at, :added_by, :banner_path, :fanart_path, :last_updated_at, :poster_path, :zap2it_id].sort
11
- end
12
-
13
- it 'should map id' do
14
- model.stub(:data).and_return('id' => 1234)
15
- model.map[:id].should == 1234
16
- end
17
-
18
- it 'should map Airs_DayOfWeek' do
19
- model.stub(:data).and_return('Airs_DayOfWeek' => 'Monday')
20
- model.map[:airs_day_of_week].should == 'Monday'
21
- end
22
-
23
- it 'should map Airs_Time' do
24
- model.stub(:data).and_return('Airs_Time' => '8:00 AM')
25
- model.map[:airs_time].should == '8:00 AM'
26
- end
27
-
28
- it 'should map ContentRating' do
29
- model.stub(:data).and_return('ContentRating' => 'TV-PG')
30
- model.map[:content_rating].should == 'TV-PG'
31
- end
32
-
33
- it 'should map FirstAired' do
34
- model.stub(:data).and_return('FirstAired' => '1997-07-01')
35
- model.map[:first_aired].should == '1997-07-01'
36
- end
37
-
38
- it 'should map Genre' do
39
- model.stub(:data).and_return('Genre' => '|comedy|')
40
- model.map[:genres].should == ['comedy']
41
- end
42
-
43
- it 'should map IMDB_ID' do
44
- model.stub(:data).and_return('IMDB_ID' => 'tt0118480')
45
- model.map[:imdb_id].should == 'tt0118480'
46
- end
47
-
48
- it 'should map Language' do
49
- model.stub(:data).and_return('Language' => 'en')
50
- model.map[:language].should == 'en'
51
- end
52
-
53
- it 'should map Network' do
54
- model.stub(:data).and_return('Network' => 'SciFi')
55
- model.map[:network].should == 'SciFi'
56
- end
57
-
58
- it 'should map NetworkID' do
59
- model.stub(:data).and_return('NetworkID' => '1')
60
- model.map[:network_id].should == '1'
61
- end
62
-
63
- it 'should map Overview' do
64
- model.stub(:data).and_return('Overview' => 'example overview')
65
- model.map[:overview].should == 'example overview'
66
- end
67
-
68
- it 'should map Rating' do
69
- model.stub(:data).and_return('Rating' => '1.0')
70
- model.map[:rating].should == '1.0'
71
- end
72
-
73
- it 'should map RatingCount' do
74
- model.stub(:data).and_return('RatingCount' => '1')
75
- model.map[:rating_count].should == '1'
76
- end
77
-
78
- it 'should map Runtime' do
79
- model.stub(:data).and_return('Runtime' => '45')
80
- model.map[:runtime].should == '45'
81
- end
82
-
83
- it 'should map SeriesName' do
84
- model.stub(:data).and_return('SeriesName' => 'Stargate SG-1')
85
- model.map[:name].should == 'Stargate SG-1'
86
- end
87
-
88
- it 'should map Status' do
89
- model.stub(:data).and_return('Status' => 'Ended')
90
- model.map[:status].should == 'Ended'
91
- end
92
-
93
- it 'should map added' do
94
- model.stub(:data).and_return('added' => '1')
95
- model.map[:added_at].should == '1'
96
- end
97
-
98
- it 'should map addedBy' do
99
- model.stub(:data).and_return('addedBy' => '1')
100
- model.map[:added_by].should == '1'
101
- end
102
-
103
- it 'should map banner' do
104
- model.stub(:data).and_return('banner' => 'PATH')
105
- model.map[:banner_path].should == 'PATH'
106
- end
107
-
108
- it 'should map fanart' do
109
- model.stub(:data).and_return('fanart' => 'PATH')
110
- model.map[:fanart_path].should == 'PATH'
111
- end
112
-
113
- it 'should map lastupdated' do
114
- model.stub(:data).and_return('lastupdated' => '1234')
115
- model.map[:last_updated_at].should == Time.at(1234)
116
- end
117
-
118
- it 'should map poster' do
119
- model.stub(:data).and_return('poster' => 'PATH')
120
- model.map[:poster_path].should == 'PATH'
121
- end
122
-
123
- it 'should map zap2it_id' do
124
- model.stub(:data).and_return('zap2it_id' => '1234')
125
- model.map[:zap2it_id].should == '1234'
126
- end
127
- end
128
- end
@@ -1,11 +0,0 @@
1
- require 'integrations/integration_spec_helper'
2
-
3
- describe ThetvdbMapper::Actors do
4
- let(:model) { ThetvdbMapper::Actors.new(80348) }
5
-
6
- describe '.data' do
7
- it 'should return array' do
8
- model.data.class.should == Array
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require 'integrations/integration_spec_helper'
2
-
3
- describe ThetvdbMapper::Banners do
4
- let(:model) { ThetvdbMapper::Banners.new(80348) }
5
-
6
- describe '.data' do
7
- it 'should return array' do
8
- model.data.class.should == Array
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require 'integrations/integration_spec_helper'
2
-
3
- describe ThetvdbMapper::Episode do
4
- let(:model) { ThetvdbMapper::Episode.new(332179) }
5
-
6
- describe '.data' do
7
- it 'should return array' do
8
- model.data.class.should == Hash
9
- end
10
- end
11
- end
@@ -1,35 +0,0 @@
1
- require 'integrations/integration_spec_helper'
2
-
3
- describe ThetvdbMapper::Fetcher do
4
- let(:model) { ThetvdbMapper::Fetcher.new }
5
-
6
- describe '.series' do
7
- it 'should return hash' do
8
- model.series(80348).body.class.should == Hash
9
- end
10
- end
11
-
12
- describe '.full_series' do
13
- it 'should return hash' do
14
- model.full_series(80348).body.class.should == Hash
15
- end
16
- end
17
-
18
- describe '.actors' do
19
- it 'should return array' do
20
- model.actors(80348).body.class.should == Array
21
- end
22
- end
23
-
24
- describe '.banners' do
25
- it 'should return array' do
26
- model.banners(80348).body.class.should == Array
27
- end
28
- end
29
-
30
- describe '.episode' do
31
- it 'should return hash' do
32
- model.episode(332179).body.class.should == Hash
33
- end
34
- end
35
- end
@@ -1,11 +0,0 @@
1
- require 'integrations/integration_spec_helper'
2
-
3
- describe ThetvdbMapper::FullSeries do
4
- let(:model) { ThetvdbMapper::FullSeries.new(80348) }
5
-
6
- describe '.data' do
7
- it 'should return array' do
8
- model.data.class.should == Hash
9
- end
10
- end
11
- end