spec/dvdprofiler2xbmc_spec.rb in royw-dvdprofiler2xbmc-0.1.0 vs spec/dvdprofiler2xbmc_spec.rb in royw-dvdprofiler2xbmc-0.1.2

- old
+ new

@@ -1,10 +1,10 @@ require File.dirname(__FILE__) + '/spec_helper.rb' require 'tempfile' -FULL_REGRESSION = false +FULL_REGRESSION = true # Time to add your specs! # http://rspec.info/ describe "Dvdprofiler2xbmc" do @@ -44,11 +44,11 @@ 'Gung Ho', 'Hot Shots', 'Meltdown', 'Oklahoma!', 'The Man From Snowy River', - 'Rooster Cogburn', + 'Rooster Cogburn (...and the Lady)', 'Call Me The Rise And Fall of Heidi Fleiss', 'batteries not included', 'Flyboys', "Captain Corelli's Mandolin", ].collect{|title| Collection.title_pattern(title)} @@ -56,15 +56,17 @@ buf.should be_empty end end if FULL_REGRESSION - it "should find all Collection titles (full regression)" do - profiles = Dvdprofiler.all - titles = profiles.collect{|profile| profile.title} - buf = regression(titles.sort) - buf.should be_empty + DvdprofilerProfile.collection_filespec = File.join(SAMPLES_DIR, 'Collection.xml') + profiles = DvdprofilerProfile.all + titles = profiles.collect{|profile| profile.title} + titles.sort.each do |title| + it "should find all Collection titles (full regression) title=>#{title}" do + regression([title]).should == [] + end end end def regression(titles) buf = [] @@ -80,10 +82,10 @@ AppConfig[:logger].debug "ISBN => #{isbn}" unless @ignore_isbns.include?(isbn.to_s) dvd_hash = dvdprofiler_profile.dvd_hash unless dvd_hash[:genres].include?('Television') count += 1 - imdb_profile = ImdbProfile.first(:titles => [dvd_hash[:title], title], + imdb_profile = ImdbProfile.first(:titles => [dvd_hash[:title], title, dvd_hash[:originaltitle]].uniq.compact, :production_years => dvd_hash[:productionyear], :released_years => dvd_hash[:released], :logger => AppConfig[:logger]) if imdb_profile.blank? buf << "Can not find IMDB ID for #{isbn} #{title}"