spec/nfo_controller_spec.rb in royw-dvdprofiler2xbmc-0.0.6 vs spec/nfo_controller_spec.rb in royw-dvdprofiler2xbmc-0.0.8
- old
+ new
@@ -19,29 +19,29 @@
AppConfig[:logger].warn { "\nNfoController Specs" }
end
before(:each) do
@media = Media.new(SAMPLES_DIR, 'The Egg and I.dummy')
- [:nfo_extension, :imdb_xml_extension, :tmdb_xml_extension].each do |extension|
+ [:imdb_xml, :tmdb_xml, :nfo].each do |extension|
filespec = @media.path_to(extension)
File.delete(filespec) if File.exist?(filespec)
end
# AppConfig[:logger].info { "media path => " + @media.media_path }
end
after(:all) do
Dir.glob(File.join(TMPDIR, "nfo_controller_spec*")).each { |filename| File.delete(filename) }
- ['imdb.xml', 'tmdb.xml', 'nfo'].each do |extension|
- filespec = File.join(File.dirname(__FILE__), "samples/The Egg and I.#{extension}")
+ [:imdb_xml, :tmdb_xml, :nfo].each do |extension|
+ filespec = File.join(File.dirname(__FILE__), "samples/The Egg and I.#{AppConfig[:extensions][extension]}")
File.delete(filespec) if File.exist?(filespec)
end
end
it "should use certifications if mpaa not available" do
NfoController.update(@media)
- filespec = @media.path_to(:nfo_extension)
+ filespec = @media.path_to(:nfo)
xml = open(filespec).read
hash = XmlSimple.xml_in(xml)
hash['mpaa'].should == ['Approved']
end
@@ -49,28 +49,33 @@
NfoController.update(@media).should be_true
end
it "should generate populated nfo file on update" do
NfoController.update(@media)
- filespec = @media.path_to(:nfo_extension)
+ filespec = @media.path_to(:nfo)
xml = open(filespec).read
hash = XmlSimple.xml_in(xml)
hash['runtime'].should == ['108 min']
end
it "should generate populated imdb.xml file on update" do
NfoController.update(@media)
- filespec = @media.path_to(:imdb_xml_extension)
+ filespec = @media.path_to(:imdb_xml)
xml = open(filespec).read
hash = XmlSimple.xml_in(xml)
hash['length'].should == ['108 min']
end
it "should generate populated tmdb.xml file on update" do
NfoController.update(@media)
- filespec = @media.path_to(:tmdb_xml_extension)
+ filespec = @media.path_to(:tmdb_xml)
xml = open(filespec).read
hash = XmlSimple.xml_in(xml)
hash.should be_empty
end
+
+# it "should handle different movies with the same title" do
+# media1 = Media.new('Sabrina - 1954')
+# media2 = Media.new('Sabrina - 1995')
+# end
end
\ No newline at end of file