spec/imdb_profile_spec.rb in royw-imdb-0.1.4 vs spec/imdb_profile_spec.rb in royw-imdb-0.1.5

- old
+ new

@@ -171,9 +171,54 @@ filespec = get_temp_filename profile = ImdbProfile.first(:filespec => filespec) profile.should be_nil end + it "should handle media year == nil" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => [nil]) + profile.should_not == nil + end + + it "should handle media year == 0" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => [0]) + profile.should_not == nil + end + + it "should handle media year == '0'" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :media_years => ['0']) + profile.should_not == nil + end + + it "should handle production year == nil" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => [nil]) + profile.should_not == nil + end + + it "should handle media production == 0" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => [0]) + profile.should_not == nil + end + + it "should handle production year == '0'" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :production_years => ['0']) + profile.should_not == nil + end + + it "should handle released year == nil" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => [nil]) + profile.should_not == nil + end + + it "should handle released year == 0" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => [0]) + profile.should_not == nil + end + + it "should handle released year == '0'" do + profile = ImdbProfile.first(:titles => ['National Treasure: Book of Secrets'], :released_years => ['0']) + profile.should_not == nil + end + def get_temp_filename outfile = Tempfile.new('imdb_profile_spec', TMPDIR) filespec = outfile.path outfile.unlink filespec \ No newline at end of file