test/unit/tmdb_test.rb in ruby-tmdb-0.0.21 vs test/unit/tmdb_test.rb in ruby-tmdb-0.1.0
- old
+ new
@@ -95,13 +95,19 @@
assert person[item]
end
end
end
- test "failed API call should return empty array" do
+ test "failed API call should return nil" do
movies = Tmdb.api_call('Movie.blarg', 'Transformers')
- assert_kind_of Array, movies
- assert movies.empty?
+ assert_kind_of NilClass, movies
+ assert_nil movies
+ end
+
+ test "API call that finds no results should return nil" do
+ movies = Tmdb.api_call('Search.empty', 'Transformers')
+ assert_kind_of NilClass, movies
+ assert_nil movies
end
test "API call cache should not be changed when data altered in the receiving method" do
person = Tmdb.api_call('Person.getInfo', 287)[0]
assert_not_nil person[person.keys[0]]
\ No newline at end of file