tvrage_api 0.0.2 → 0.1.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 +26 -13
- data/lib/tvrage_api/base.rb +25 -6
- data/lib/tvrage_api/client.rb +13 -0
- data/lib/tvrage_api/search.rb +9 -0
- data/lib/tvrage_api/show.rb +14 -19
- data/lib/tvrage_api/update.rb +5 -0
- data/lib/tvrage_api/version.rb +1 -1
- data/lib/tvrage_api.rb +3 -7
- data/spec/integrations/client_spec.rb +55 -0
- data/spec/integrations/search_spec.rb +7 -7
- data/spec/integrations/show_spec.rb +12 -12
- data/spec/integrations/update_spec.rb +5 -6
- data/spec/tvrage_api/base_spec.rb +56 -0
- data/spec/tvrage_api/client_spec.rb +23 -0
- data/spec/tvrage_api/search_spec.rb +22 -0
- data/spec/tvrage_api/show_spec.rb +18 -59
- data/spec/tvrage_api/update_spec.rb +14 -0
- data/tvrage_api.gemspec +1 -2
- metadata +15 -53
- data/lib/tvrage_api/element.rb +0 -3
- data/lib/tvrage_api/episode.rb +0 -9
- data/lib/tvrage_api/request/base.rb +0 -57
- data/lib/tvrage_api/request/search.rb +0 -13
- data/lib/tvrage_api/request/show.rb +0 -37
- data/lib/tvrage_api/request/update.rb +0 -13
- data/lib/tvrage_api/utility/aka_array.rb +0 -9
- data/lib/tvrage_api/utility/date.rb +0 -9
- data/lib/tvrage_api/utility/date_or_integer.rb +0 -11
- data/lib/tvrage_api/utility/episode_array.rb +0 -15
- data/lib/tvrage_api/utility/genre_array.rb +0 -9
- data/lib/tvrage_api/utility/hashie/extensions/key_replace.rb +0 -42
- data/lib/tvrage_api/utility/integer.rb +0 -5
- data/lib/tvrage_api/utility/string.rb +0 -11
- data/lib/tvrage_api/utility.rb +0 -8
- data/spec/tvrage_api/episode_spec.rb +0 -51
- data/spec/tvrage_api/request/base_spec.rb +0 -113
- data/spec/tvrage_api/request/search_spec.rb +0 -30
- data/spec/tvrage_api/request/show_spec.rb +0 -71
- data/spec/tvrage_api/request/update_spec.rb +0 -28
- data/spec/tvrage_api/utility/aka_array_spec.rb +0 -17
- data/spec/tvrage_api/utility/date_or_integer_spec.rb +0 -13
- data/spec/tvrage_api/utility/date_spec.rb +0 -13
- data/spec/tvrage_api/utility/genre_array_spec.rb +0 -17
- data/spec/tvrage_api/utility/integer_spec.rb +0 -9
- data/spec/tvrage_api/utility/string_spec.rb +0 -9
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe AkaArray do
|
4
|
-
describe '#coerce' do
|
5
|
-
describe 'when value is Array' do
|
6
|
-
it 'should return Array' do
|
7
|
-
AkaArray.coerce([]).should == []
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
describe 'when value is not Array' do
|
12
|
-
it 'should return Array' do
|
13
|
-
AkaArray.coerce(double(aka: [double(country: 'EN', __content__: 'test')])).first.class.should == TvrageApi::Element
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe DateOrInteger do
|
4
|
-
describe '#coerce' do
|
5
|
-
it 'should convert string to date' do
|
6
|
-
DateOrInteger.coerce('2001/02/03').should == Date.new(2001, 2, 3)
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should return integer for no date string' do
|
10
|
-
DateOrInteger.coerce('2000').should == 2000
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Date do
|
4
|
-
describe '#coerce' do
|
5
|
-
it 'should convert string to date' do
|
6
|
-
Date.coerce('2001-02-03').should == Date.new(2001, 2, 3)
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should return nil for no date string' do
|
10
|
-
Date.coerce('test').should == nil
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe GenreArray do
|
4
|
-
describe '#coerce' do
|
5
|
-
describe 'when value is Array' do
|
6
|
-
it 'should return Array' do
|
7
|
-
GenreArray.coerce([]).should == []
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
describe 'when value is not Array' do
|
12
|
-
it 'should return Array' do
|
13
|
-
GenreArray.coerce(double(genre: 'Action')).should == 'Action'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|