tvrage_api 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 770687502ef4bed24d33cd8f46cdc1899e36d64d
4
- data.tar.gz: dade9e9f981d4fcc935c94cbb52e94d10e67816d
3
+ metadata.gz: 4f915d2a0d1255f5d8185be941412f209d833f95
4
+ data.tar.gz: 1d5ee554e1768a81e3dadae6832ec055ed6192b2
5
5
  SHA512:
6
- metadata.gz: 3f208019294a07196dc7e772624674d36e4a80928132053404ef0e4ddc5c7c3879a4248d347f4ddd20185099f8a48795535f8f54ac5b2cce76910d925216fd4c
7
- data.tar.gz: 01b54ceb78671945147f352880c8a810491638542f7dbb7f9203f96b035afdbb9eb4027dc3e1a42c4d756a93391a78640496aee411e0df53a21ef317c4644983
6
+ metadata.gz: f1c24dd87ee9f99d00668ed53ef11fd64bdf175e43d89d289123121d8a7bcd1f459ff5dc3ad145e97f51f9c717b50ad432462342c7c833a8cb363a5db24408a7
7
+ data.tar.gz: e78253e1311d7f92f3f951910912abb5b88fd618a26bbbe68b84d0d77f620df26e21bd0107a4f2755317bcc869c1377ccca6a4452c04b0c491fe72637d3c4a31
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  script: 'bundle exec rspec spec/functionals'
3
3
  rvm:
4
+ - 1.9.3
4
5
  - 2.0.0
6
+ - 2.1.0
data/README.md CHANGED
@@ -19,11 +19,11 @@ Run the bundle command to install it.
19
19
 
20
20
  ## How to use
21
21
 
22
- There is one entry point:
22
+ You have two way for access to api:
23
23
 
24
- ```ruby
25
- client = TvrageApi::Client.new
26
- ```
24
+ * I way (create client class, one entry point)
25
+
26
+ * II way (direct access to api class, many entry points)
27
27
 
28
28
  Search show by name:
29
29
 
@@ -33,6 +33,12 @@ client.search.by_name(show: 'buffy')
33
33
  client.search.full_by_name(show: 'buffy')
34
34
  ```
35
35
 
36
+ ```ruby
37
+ search = TvrageApi::Search.new
38
+ search.by_name(show: 'buffy')
39
+ search.full_by_name(show: 'buffy')
40
+ ```
41
+
36
42
  Search show by id:
37
43
 
38
44
  ```ruby
@@ -44,6 +50,15 @@ client.show.episode(sid: '123', ep: 'SEASONxEPISODE') # show with specific episo
44
50
  client.show.all
45
51
  ```
46
52
 
53
+ ```ruby
54
+ show = TvrageApi::Show.new
55
+ show.find(sid: '123')
56
+ show.find_full(sid: '123')
57
+ show.episodes(sid: '123') # show with all episodes
58
+ show.episode(sid: '123', ep: 'SEASONxEPISODE') # show with specific episode
59
+ show.all
60
+ ```
61
+
47
62
  QuickInfo (it return plain text, not parsed)
48
63
 
49
64
  ```ruby
@@ -53,6 +68,13 @@ client.info.find(show: 'Alias', ep: '2x04') # episode information
53
68
  client.info.find(show: 'Alias', exact: 1) # exact information
54
69
  ```
55
70
 
71
+ ```ruby
72
+ info = TvrageApi::Info.new
73
+ info.find(show: 'Alias') # main information
74
+ info.find(show: 'Alias', ep: '2x04') # episode information
75
+ info.find(show: 'Alias', exact: 1) # exact information
76
+ ```
77
+
56
78
  Schedule (quick method return plain text)
57
79
 
58
80
  ```ruby
@@ -61,6 +83,12 @@ client.schedule.quick
61
83
  client.schedule.full(country: 'US')
62
84
  ```
63
85
 
86
+ ```ruby
87
+ schedule = TvrageApi::Schedule.new
88
+ schedule.quick
89
+ schedule.full(country: 'US')
90
+ ```
91
+
64
92
  Recaps
65
93
 
66
94
  ```ruby
@@ -70,6 +98,13 @@ client.recap.show(show: 5410)
70
98
  client.recap.last(days: 100)
71
99
  ```
72
100
 
101
+ ```ruby
102
+ recaps = TvrageApi::Recaps.new
103
+ recap.all
104
+ recap.show(show: 5410)
105
+ recap.last(days: 100)
106
+ ```
107
+
73
108
  Updates:
74
109
 
75
110
  ```ruby
@@ -80,6 +115,14 @@ client.update.last(sort: 'episodes') # only shows where episodes have changed
80
115
  client.update.last(since: 1403668430) # updates since last visit
81
116
  ```
82
117
 
118
+ ```ruby
119
+ update = TvrageApi::Update.new
120
+ update.last # last 24 hours
121
+ update.last(hours: 48) # set timeline (default: 48)
122
+ update.last(sort: 'episodes') # only shows where episodes have changed
123
+ update.last(since: 1403668430) # updates since last visit
124
+ ```
125
+
83
126
  ## Contributing
84
127
 
85
128
  1. Fork it
@@ -1,33 +1,33 @@
1
1
  class TvrageApi::Client
2
- attr_reader :options
2
+ attr_reader :config
3
3
 
4
- def initialize(options = {})
5
- @options = options
4
+ def initialize(config = {})
5
+ @config = config
6
6
 
7
- @options[:adapter] ||= :net_http
7
+ @config[:adapter] ||= :net_http
8
8
  end
9
9
 
10
10
  def search
11
- @search ||= TvrageApi::Search.new(self)
11
+ @search ||= TvrageApi::Search.new(config)
12
12
  end
13
13
 
14
14
  def show
15
- @show ||= TvrageApi::Show.new(self)
15
+ @show ||= TvrageApi::Show.new(config)
16
16
  end
17
17
 
18
18
  def update
19
- @update ||= TvrageApi::Update.new(self)
19
+ @update ||= TvrageApi::Update.new(config)
20
20
  end
21
21
 
22
22
  def info
23
- @info ||= TvrageApi::Info.new(self)
23
+ @info ||= TvrageApi::Info.new(config)
24
24
  end
25
25
 
26
26
  def schedule
27
- @schedule ||= TvrageApi::Schedule.new(self)
27
+ @schedule ||= TvrageApi::Schedule.new(config)
28
28
  end
29
29
 
30
30
  def recap
31
- @recap ||= TvrageApi::Recap.new(self)
31
+ @recap ||= TvrageApi::Recap.new(config)
32
32
  end
33
33
  end
@@ -1,8 +1,24 @@
1
1
  class TvrageApi::Info < TvrageApi::Base
2
+ # Quick information about tv show
3
+ #
4
+ # access: FREE
5
+ # param: options hash
6
+ # show: TV show name
7
+ # ep: episode name, format [Season Number]x[Episode Number, with zero at the beginning for 1-9] (optional)
8
+ # exact: 1, Only shows that match exactly will be given.
9
+ # output: Faraday::Response instance with string
2
10
  def find(options = {})
3
11
  find_path_with_params(options).get
4
12
  end
5
13
 
14
+ # Quick information about tv show - return only url
15
+ #
16
+ # access: FREE
17
+ # param: options hash
18
+ # show: TV show name
19
+ # ep: episode name, format [Season Number]x[Episode Number, with zero at the beginning for 1-9] (optional)
20
+ # exact: 1, Only shows that match exactly will be given.
21
+ # output: url string
6
22
  def find_url(options = {})
7
23
  find_path_with_params(options).url
8
24
  end
@@ -1,24 +1,56 @@
1
1
  class TvrageApi::Recap < TvrageApi::Base
2
+ # All recaps
3
+ #
4
+ # access: FREE
5
+ # output: Faraday::Response instance with parsed XML string
2
6
  def all
3
7
  path(all_path).get
4
8
  end
5
9
 
10
+ # All recaps - return only url
11
+ #
12
+ # access: FREE
13
+ # output: url string
6
14
  def all_url
7
15
  path(all_path).url
8
16
  end
9
17
 
18
+ # Recaps From Selected Show
19
+ #
20
+ # access: FREE
21
+ # param: options hash
22
+ # show: TV show ID
23
+ # output: Faraday::Response instance with parsed XML string
10
24
  def show(options = {})
11
25
  show_path_with_params(options).get
12
26
  end
13
27
 
28
+ # Recaps From Selected Show - return only url
29
+ #
30
+ # access: FREE
31
+ # param: options hash
32
+ # show: TV show ID
33
+ # output: url string
14
34
  def show_url(options = {})
15
35
  show_path_with_params(options).url
16
36
  end
17
37
 
38
+ # Latest Recaps
39
+ #
40
+ # access: FREE
41
+ # param: options hash
42
+ # days: last x days (default 30)
43
+ # output: Faraday::Response instance with parsed XML string
18
44
  def last(options = {})
19
45
  last_path_with_params(options).get
20
46
  end
21
47
 
48
+ # Latest Recaps - return only url
49
+ #
50
+ # access: FREE
51
+ # param: options hash
52
+ # days: last x days (default 30)
53
+ # output: url string
22
54
  def last_url(options = {})
23
55
  last_path_with_params(options).url
24
56
  end
@@ -1,16 +1,42 @@
1
1
  class TvrageApi::Schedule < TvrageApi::Base
2
+ # Quick access to TV schedule
3
+ #
4
+ # access: FREE
5
+ # param: options hash
6
+ # country: two chars country abbreviation (optional)
7
+ # output: Faraday::Response instance with string
2
8
  def quick(options = {})
3
9
  quick_path_with_params(options).get
4
10
  end
5
11
 
12
+ # Quick access to TV schedule - return only url
13
+ #
14
+ # access: FREE
15
+ # param: options hash
16
+ # country: two chars country abbreviation (optional)
17
+ # output: url string
6
18
  def quick_url(options = {})
7
19
  quick_path_with_params(options).url
8
20
  end
9
21
 
22
+ # Full Schedule
23
+ #
24
+ # access: FREE
25
+ # param: options hash
26
+ # country: two chars country abbreviation (optional)
27
+ # 24_format: 1, time format (optional)
28
+ # output: Faraday::Response instance with parsed XML string
10
29
  def full(options = {})
11
30
  full_path_with_params(options).get
12
31
  end
13
32
 
33
+ # Full Schedule - return only url
34
+ #
35
+ # access: FREE
36
+ # param: options hash
37
+ # country: two chars country abbreviation (optional)
38
+ # 24_format: 1, time format (optional)
39
+ # output: url string
14
40
  def full_url(options = {})
15
41
  full_path_with_params(options).url
16
42
  end
@@ -1,16 +1,40 @@
1
1
  class TvrageApi::Search < TvrageApi::Base
2
+ # Search tv show by name
3
+ #
4
+ # access: FREE
5
+ # param: options hash
6
+ # show: TV show name
7
+ # output: Faraday::Response instance with string
2
8
  def by_name(options = {})
3
9
  by_name_path_with_params(options).get
4
10
  end
5
11
 
12
+ # Search tv show by name - return only url
13
+ #
14
+ # access: FREE
15
+ # param: options hash
16
+ # show: TV show name
17
+ # output: url string
6
18
  def by_name_url(options = {})
7
19
  by_name_path_with_params(options).url
8
20
  end
9
21
 
22
+ # Detailed Search tv show by name
23
+ #
24
+ # access: FREE
25
+ # param: options hash
26
+ # show: TV show name
27
+ # output: Faraday::Response instance with string
10
28
  def full_by_name(options = {})
11
29
  full_by_name_path_with_params(options).get
12
30
  end
13
31
 
32
+ # Detailed Search tv show by name - return only url
33
+ #
34
+ # access: FREE
35
+ # param: options hash
36
+ # show: TV show name
37
+ # output: url string
14
38
  def full_by_name_url(options = {})
15
39
  full_by_name_path_with_params(options).url
16
40
  end
@@ -1,40 +1,101 @@
1
1
  class TvrageApi::Show < TvrageApi::Base
2
+ # Show Info
3
+ #
4
+ # access: FREE
5
+ # param: options hash
6
+ # sid: TV show ID
7
+ # output: Faraday::Response instance with string
2
8
  def find(options = {})
3
9
  find_path_with_params(options).get
4
10
  end
5
11
 
12
+ # Show Info - return only url
13
+ #
14
+ # access: FREE
15
+ # param: options hash
16
+ # sid: TV show ID
17
+ # output: url string
6
18
  def find_url(options = {})
7
19
  find_path_with_params(options).url
8
20
  end
9
21
 
22
+ # Show Info + Episode List
23
+ #
24
+ # access: FREE
25
+ # param: options hash
26
+ # sid: TV show ID
27
+ # output: Faraday::Response instance with string
10
28
  def find_full(options = {})
11
29
  find_full_path_with_params(options).get
12
30
  end
13
31
 
32
+ # Show Info + Episode List - return only url
33
+ #
34
+ # access: FREE
35
+ # param: options hash
36
+ # sid: TV show ID
37
+ # output: url string
14
38
  def find_full_url(options = {})
15
39
  find_full_path_with_params(options).url
16
40
  end
17
41
 
42
+ # Episode List
43
+ #
44
+ # access: FREE
45
+ # param: options hash
46
+ # sid: TV show ID
47
+ # output: Faraday::Response instance with string
18
48
  def episodes(options = {})
19
49
  episodes_path_with_params(options).get
20
50
  end
21
51
 
52
+
53
+ # Episode List
54
+ #
55
+ # access: FREE
56
+ # param: options hash
57
+ # sid: TV show ID
58
+ # output: url string
22
59
  def episodes_url(options = {})
23
60
  episodes_path_with_params(options).url
24
61
  end
25
62
 
63
+ # Episode Info
64
+ #
65
+ # access: FREE
66
+ # param: options hash
67
+ # sid: TV show ID
68
+ # ep: episode name, format [Season Number]x[Episode Number, with zero at the beginning for 1-9]
69
+ # output: Faraday::Response instance with string
26
70
  def episode(options = {})
27
71
  episode_path_with_params(options).get
28
72
  end
29
73
 
74
+
75
+ # Episode Info - return only url
76
+ #
77
+ # access: FREE
78
+ # param: options hash
79
+ # sid: TV show ID
80
+ # ep: episode name, format [Season Number]x[Episode Number, with zero at the beginning for 1-9]
81
+ # output: url string
30
82
  def episode_url(options = {})
31
83
  episode_path_with_params(options).url
32
84
  end
33
85
 
86
+ # Full Show List
87
+ #
88
+ # access: FREE
89
+ # output: Faraday::Response instance with string
34
90
  def all
35
91
  path(all_path).get
36
92
  end
37
93
 
94
+
95
+ # Full Show List - return only url
96
+ #
97
+ # access: FREE
98
+ # output: url string
38
99
  def all_url
39
100
  path(all_path).url
40
101
  end
@@ -1,8 +1,24 @@
1
1
  class TvrageApi::Update < TvrageApi::Base
2
+ # List For Last Updated Shows
3
+ #
4
+ # access: FREE
5
+ # param: options hash
6
+ # hours: number of hours (optional)
7
+ # sort: unfortunatelly unspecified (optional)
8
+ # since: timestampe (optional)
9
+ # output: Faraday::Response instance with parsed XML string
2
10
  def last(options = {})
3
11
  last_path_with_params(options).get
4
12
  end
5
13
 
14
+ # List For Last Updated Shows - return only url
15
+ #
16
+ # access: FREE
17
+ # param: options hash
18
+ # hours: number of hours (optional)
19
+ # sort: unfortunatelly unspecified (optional)
20
+ # since: timestampe (optional)
21
+ # output: url string
6
22
  def last_url(options = {})
7
23
  last_path_with_params(options).url
8
24
  end
@@ -1,3 +1,3 @@
1
1
  module TvrageApi
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -14,17 +14,17 @@ describe TvrageApi::Info do
14
14
 
15
15
  describe '.find' do
16
16
  it 'should return Faraday::Response class' do
17
- model.find(show: 'Alias').class.should == Faraday::Response
17
+ expect(model.find(show: 'Alias')).to be_a(Faraday::Response)
18
18
  end
19
19
 
20
20
  it 'should return String class for body reponse' do
21
- model.find(show: 'Alias').body == String
21
+ expect(model.find(show: 'Alias').body).to be_a(String)
22
22
  end
23
23
  end
24
24
 
25
25
  describe '.find_url' do
26
26
  it 'should return correct url' do
27
- model.find_url(show: 'Alias').should == 'http://services.tvrage.com/tools/quickinfo.php?show=Alias'
27
+ expect(model.find_url(show: 'Alias')).to eq('http://services.tvrage.com/tools/quickinfo.php?show=Alias')
28
28
  end
29
29
  end
30
30
  end
@@ -18,49 +18,49 @@ describe TvrageApi::Recap do
18
18
 
19
19
  describe '.all' do
20
20
  it 'should return Faraday::Response class' do
21
- model.all.class.should == Faraday::Response
21
+ expect(model.all).to be_a(Faraday::Response)
22
22
  end
23
23
 
24
24
  it 'should return Hash class for body reponse' do
25
- model.all.body == Hash
25
+ expect(model.all.body).to be_a(Hash)
26
26
  end
27
27
  end
28
28
 
29
29
  describe '.all_url' do
30
30
  it 'should return correct url' do
31
- model.all_url.should == 'http://services.tvrage.com/recaps/all_recaps.php'
31
+ expect(model.all_url).to eq('http://services.tvrage.com/recaps/all_recaps.php')
32
32
  end
33
33
  end
34
34
 
35
35
  describe '.show' do
36
36
  it 'should return Faraday::Response class' do
37
- model.show(show: 5410).class.should == Faraday::Response
37
+ expect(model.show(show: 5410)).to be_a(Faraday::Response)
38
38
  end
39
39
 
40
40
  it 'should return Hash class for body reponse' do
41
- model.show(show: 5410).body == Hash
41
+ expect(model.show(show: 5410).body).to be_a(Hash)
42
42
  end
43
43
  end
44
44
 
45
45
  describe '.all_url' do
46
46
  it 'should return correct url' do
47
- model.show_url(show: 5410).should == 'http://services.tvrage.com/recaps/show_recaps.php?show=5410'
47
+ expect(model.show_url(show: 5410)).to eq('http://services.tvrage.com/recaps/show_recaps.php?show=5410')
48
48
  end
49
49
  end
50
50
 
51
51
  describe '.last' do
52
52
  it 'should return Faraday::Response class' do
53
- model.last.class.should == Faraday::Response
53
+ expect(model.last).to be_a(Faraday::Response)
54
54
  end
55
55
 
56
56
  it 'should return Hash class for body reponse' do
57
- model.last.body == Hash
57
+ expect(model.last.body).to be_a(Hash)
58
58
  end
59
59
  end
60
60
 
61
61
  describe '.all_url' do
62
62
  it 'should return correct url' do
63
- model.last_url.should == 'http://services.tvrage.com/recaps/last_recaps.php'
63
+ expect(model.last_url).to eq('http://services.tvrage.com/recaps/last_recaps.php')
64
64
  end
65
65
  end
66
66
  end
@@ -16,33 +16,33 @@ describe TvrageApi::Schedule do
16
16
 
17
17
  describe '.quick' do
18
18
  it 'should return Faraday::Response class' do
19
- model.quick.class.should == Faraday::Response
19
+ expect(model.quick).to be_a(Faraday::Response)
20
20
  end
21
21
 
22
22
  it 'should return String class for body reponse' do
23
- model.quick.body == String
23
+ expect(model.quick.body).to be_a(String)
24
24
  end
25
25
  end
26
26
 
27
27
  describe '.quick_url' do
28
28
  it 'should return correct url' do
29
- model.quick_url.should == 'http://services.tvrage.com/tools/quickschedule.php'
29
+ expect(model.quick_url).to eq('http://services.tvrage.com/tools/quickschedule.php')
30
30
  end
31
31
  end
32
32
 
33
33
  describe '.full' do
34
34
  it 'should return Faraday::Response class' do
35
- model.full(country: 'US').class.should == Faraday::Response
35
+ expect(model.full(country: 'US')).to be_a(Faraday::Response)
36
36
  end
37
37
 
38
38
  it 'should return Hash class for body reponse' do
39
- model.full(country: 'US').body == Hash
39
+ expect(model.full(country: 'US').body).to be_a(Hash)
40
40
  end
41
41
  end
42
42
 
43
43
  describe '.quick_url' do
44
44
  it 'should return correct url' do
45
- model.full_url(country: 'US').should == 'http://services.tvrage.com/feeds/fullschedule.php?country=US'
45
+ expect(model.full_url(country: 'US')).to eq('http://services.tvrage.com/feeds/fullschedule.php?country=US')
46
46
  end
47
47
  end
48
48
  end
@@ -16,33 +16,33 @@ describe TvrageApi::Search do
16
16
 
17
17
  describe '.by_name' do
18
18
  it 'should return Faraday::Response class' do
19
- model.by_name(show: 'buffy').class.should == Faraday::Response
19
+ expect(model.by_name(show: 'buffy')).to be_a(Faraday::Response)
20
20
  end
21
21
 
22
22
  it 'should return Hash class for body reponse' do
23
- model.by_name(show: 'buffy').body == Hash
23
+ expect(model.by_name(show: 'buffy').body).to be_a(Hash)
24
24
  end
25
25
  end
26
26
 
27
27
  describe '.by_name_url' do
28
28
  it 'should return correct url' do
29
- model.by_name_url(show: 'buffy').should == 'http://services.tvrage.com/feeds/search.php?show=buffy'
29
+ expect(model.by_name_url(show: 'buffy')).to eq('http://services.tvrage.com/feeds/search.php?show=buffy')
30
30
  end
31
31
  end
32
32
 
33
33
  describe '.full_by_name' do
34
34
  it 'should return Faraday::Response class' do
35
- model.full_by_name(show: 'buffy').class.should == Faraday::Response
35
+ expect(model.full_by_name(show: 'buffy')).to be_a(Faraday::Response)
36
36
  end
37
37
 
38
38
  it 'should return Hash class for body reponse' do
39
- model.full_by_name(show: 'buffy').body == Hash
39
+ expect(model.full_by_name(show: 'buffy').body).to be_a(Hash)
40
40
  end
41
41
  end
42
42
 
43
43
  describe '.full_by_name_url' do
44
44
  it 'should return correct url' do
45
- model.full_by_name_url(show: 'buffy').should == 'http://services.tvrage.com/feeds/full_search.php?show=buffy'
45
+ expect(model.full_by_name_url(show: 'buffy')).to eq('http://services.tvrage.com/feeds/full_search.php?show=buffy')
46
46
  end
47
47
  end
48
48
  end
@@ -22,81 +22,81 @@ describe TvrageApi::Show do
22
22
 
23
23
  describe '.find' do
24
24
  it 'should return Faraday::Response class' do
25
- model.find(sid: 2930).class.should == Faraday::Response
25
+ expect(model.find(sid: 2930)).to be_a(Faraday::Response)
26
26
  end
27
27
 
28
28
  it 'should return Hash class for body reponse' do
29
- model.find(sid: 2930).body == Hash
29
+ expect(model.find(sid: 2930).body).to be_a(Hash)
30
30
  end
31
31
  end
32
32
 
33
33
  describe '.find_url' do
34
34
  it 'should return correct url' do
35
- model.find_url(sid: 2930).should == 'http://services.tvrage.com/feeds/showinfo.php?sid=2930'
35
+ expect(model.find_url(sid: 2930)).to eq('http://services.tvrage.com/feeds/showinfo.php?sid=2930')
36
36
  end
37
37
  end
38
38
 
39
39
  describe '.find_full' do
40
40
  it 'should return Faraday::Response class' do
41
- model.find_full(sid: 2930).class.should == Faraday::Response
41
+ expect(model.find_full(sid: 2930)).to be_a(Faraday::Response)
42
42
  end
43
43
 
44
44
  it 'should return Hash class for body reponse' do
45
- model.find_full(sid: 2930).body == Hash
45
+ expect(model.find_full(sid: 2930).body).to be_a(Hash)
46
46
  end
47
47
  end
48
48
 
49
49
  describe '.find_full_url' do
50
50
  it 'should return correct url' do
51
- model.find_full_url(sid: 2930).should == 'http://services.tvrage.com/feeds/full_show_info.php?sid=2930'
51
+ expect(model.find_full_url(sid: 2930)).to eq('http://services.tvrage.com/feeds/full_show_info.php?sid=2930')
52
52
  end
53
53
  end
54
54
 
55
55
  describe '.episodes' do
56
56
  it 'should return Faraday::Response class' do
57
- model.episodes(sid: 2930).class.should == Faraday::Response
57
+ expect(model.episodes(sid: 2930)).to be_a(Faraday::Response)
58
58
  end
59
59
 
60
60
  it 'should return Hash class for body reponse' do
61
- model.episodes(sid: 2930).body == Hash
61
+ expect(model.episodes(sid: 2930).body).to be_a(Hash)
62
62
  end
63
63
  end
64
64
 
65
65
  describe '.episodes_url' do
66
66
  it 'should return correct url' do
67
- model.episodes_url(sid: 2930).should == 'http://services.tvrage.com/feeds/episode_list.php?sid=2930'
67
+ expect(model.episodes_url(sid: 2930)).to eq('http://services.tvrage.com/feeds/episode_list.php?sid=2930')
68
68
  end
69
69
  end
70
70
 
71
71
  describe '.episode' do
72
72
  it 'should return Faraday::Response class' do
73
- model.episode(sid: 2930, ep: '2x04').class.should == Faraday::Response
73
+ expect(model.episode(sid: 2930, ep: '2x04')).to be_a(Faraday::Response)
74
74
  end
75
75
 
76
76
  it 'should return Hash class for body reponse' do
77
- model.episode(sid: 2930, ep: '2x04').body == Hash
77
+ expect(model.episode(sid: 2930, ep: '2x04').body).to be_a(Hash)
78
78
  end
79
79
  end
80
80
 
81
81
  describe '.episode_url' do
82
82
  it 'should return correct url' do
83
- model.episode_url(sid: 2930, ep: '2x04').should == 'http://services.tvrage.com/feeds/episodeinfo.php?sid=2930&ep=2x04'
83
+ expect(model.episode_url(sid: 2930, ep: '2x04')).to eq('http://services.tvrage.com/feeds/episodeinfo.php?sid=2930&ep=2x04')
84
84
  end
85
85
  end
86
86
 
87
87
  describe '.all' do
88
88
  it 'should return Faraday::Response class' do
89
- model.all.class.should == Faraday::Response
89
+ expect(model.all).to be_a(Faraday::Response)
90
90
  end
91
91
 
92
92
  it 'should return Hash class for body reponse' do
93
- model.all.body == Hash
93
+ expect(model.all.body).to be_a(Hash)
94
94
  end
95
95
  end
96
96
 
97
97
  describe '.find_url' do
98
98
  it 'should return correct url' do
99
- model.all_url.should == 'http://services.tvrage.com/feeds/show_list.php'
99
+ expect(model.all_url).to eq('http://services.tvrage.com/feeds/show_list.php')
100
100
  end
101
101
  end
102
102
  end
@@ -14,17 +14,17 @@ describe TvrageApi::Update do
14
14
 
15
15
  describe '.last' do
16
16
  it 'should return Faraday::Response class' do
17
- model.last.class.should == Faraday::Response
17
+ expect(model.last).to be_a(Faraday::Response)
18
18
  end
19
19
 
20
20
  it 'should return Hash class for body reponse' do
21
- model.last.body == Hash
21
+ expect(model.last.body).to be_a(Hash)
22
22
  end
23
23
  end
24
24
 
25
25
  describe '.last_url' do
26
26
  it 'should return correct url' do
27
- model.last_url.should == 'http://services.tvrage.com/feeds/last_updates.php'
27
+ expect(model.last_url).to eq('http://services.tvrage.com/feeds/last_updates.php')
28
28
  end
29
29
  end
30
30
  end
data/tvrage_api.gemspec CHANGED
@@ -18,10 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_runtime_dependency 'service_api', '~> 0.0.4'
21
+ spec.add_runtime_dependency 'service_api', '~> 0.0.5'
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.3'
24
24
  spec.add_development_dependency 'rake'
25
- spec.add_development_dependency 'rspec', '>= 2.14.1'
25
+ spec.add_development_dependency 'rspec', '~> 3.0.0'
26
26
  spec.add_development_dependency 'coveralls', '>= 0.7'
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tvrage_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Wawer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: service_api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.4
19
+ version: 0.0.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.4
26
+ version: 0.0.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 2.14.1
61
+ version: 3.0.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 2.14.1
68
+ version: 3.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: coveralls
71
71
  requirement: !ruby/object:Gem::Requirement