imdb_lists 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,8 +65,8 @@ describe ImdbLists::Watchlist do
65
65
 
66
66
  context "non public" do
67
67
  before(:each) do
68
- stub_request(:get, @full_url).to_return(:body => File.new("spec/fixtures/non_public_watchlist.html"), :status => 200)
69
- end
68
+ stub_request(:get, @full_url).to_return(:body => File.new("spec/fixtures/non_public_watchlist.html"), :status => 200)
69
+ end
70
70
 
71
71
  it "should return an empty list" do
72
72
  @ivh.should have(0).movies
@@ -95,4 +95,42 @@ describe ImdbLists::Watchlist do
95
95
  lambda { ImdbLists::find_by_url(@url) }.should_not raise_error(ArgumentError)
96
96
  end
97
97
  end
98
+
99
+ context "errors" do
100
+ before(:each) do
101
+ stub_request(:get, @full_url).to_return do
102
+ raise RestClient::Exception
103
+ end
104
+ end
105
+
106
+ it "should raise an error" do
107
+ lambda { @ivh.movies }.should_not raise_error(RestClient::Exception)
108
+ end
109
+
110
+ it "should be possible to turn of request errors" do
111
+ lambda { @ivh.errors(true).movies }.should raise_error(RestClient::Exception)
112
+ end
113
+ end
114
+
115
+ context "redirect" do
116
+ before(:each) do
117
+ stub_request(:get, @full_url).to_return(:body => File.new("spec/fixtures/redirect_watchlist.html"), :status => 200)
118
+ end
119
+
120
+ it "should not return any movies" do
121
+ @ivh.should have(0).movies
122
+ end
123
+
124
+ it "should find any title" do
125
+ @ivh.title.should be_nil
126
+ end
127
+
128
+ it "should still have an id" do
129
+ @ivh.id.should eq("2BZy80bxY2U")
130
+ end
131
+
132
+ it "should not have a user" do
133
+ @ivh.user.should be_nil
134
+ end
135
+ end
98
136
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: imdb_lists
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Linus Oleander
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-15 00:00:00 +02:00
13
+ date: 2011-04-17 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -47,7 +47,7 @@ dependencies:
47
47
  type: :runtime
48
48
  version_requirements: *id003
49
49
  - !ruby/object:Gem::Dependency
50
- name: rspec
50
+ name: abstract
51
51
  prerelease: false
52
52
  requirement: &id004 !ruby/object:Gem::Requirement
53
53
  none: false
@@ -55,10 +55,10 @@ dependencies:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  version: "0"
58
- type: :development
58
+ type: :runtime
59
59
  version_requirements: *id004
60
60
  - !ruby/object:Gem::Dependency
61
- name: webmock
61
+ name: rspec
62
62
  prerelease: false
63
63
  requirement: &id005 !ruby/object:Gem::Requirement
64
64
  none: false
@@ -68,6 +68,17 @@ dependencies:
68
68
  version: "0"
69
69
  type: :development
70
70
  version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: webmock
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ type: :development
81
+ version_requirements: *id006
71
82
  description: Get easy access to any public IMDb list, such as; Watchlists and Vote history lists. Extract information from each movie like; title, release date, rating, actors
72
83
  email:
73
84
  - linus@oleander.nu
@@ -85,6 +96,7 @@ files:
85
96
  - Rakefile
86
97
  - imdb_vote_history.gemspec
87
98
  - lib/imdb_lists.rb
99
+ - lib/imdb_lists/base.rb
88
100
  - lib/imdb_lists/container.rb
89
101
  - lib/imdb_lists/history.rb
90
102
  - lib/imdb_lists/watchlist.rb
@@ -95,6 +107,7 @@ files:
95
107
  - spec/fixtures/non_public_watchlist.html
96
108
  - spec/fixtures/pagination.html
97
109
  - spec/fixtures/pagination_end.html
110
+ - spec/fixtures/redirect_watchlist.html
98
111
  - spec/fixtures/watchlist.html
99
112
  - spec/history_spec.rb
100
113
  - spec/spec_helper.rb
@@ -135,6 +148,7 @@ test_files:
135
148
  - spec/fixtures/non_public_watchlist.html
136
149
  - spec/fixtures/pagination.html
137
150
  - spec/fixtures/pagination_end.html
151
+ - spec/fixtures/redirect_watchlist.html
138
152
  - spec/fixtures/watchlist.html
139
153
  - spec/history_spec.rb
140
154
  - spec/spec_helper.rb