Sha256: dda11a1252bc8075b67418c04fdd594fbfa381de9662841c9e4c75a782d6e16f

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 KB

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

require 'tempfile'

# Time to add your specs!
# http://rspec.info/

describe "DvdprofilerProfile" do

  before(:all) do
    logger = Log4r::Logger.new('dvdprofiler2xbmc')
    logger.outputters = Log4r::StdoutOutputter.new(:console)
    Log4r::Outputter[:console].formatter  = Log4r::PatternFormatter.new(:pattern => "%m")
    logger.level = Log4r::WARN
    AppConfig.default
    AppConfig[:logger] = logger
    AppConfig.load
    AppConfig[:collection_filespec] = 'spec/samples/Collection.xml'
    File.mkdirs(TMPDIR)
    AppConfig[:logger].warn { "\nDvdprofilerProfile Specs" }
  end

  before(:each) do
    @profile = DvdprofilerProfile.first(:isbn => '786936735390')
  end

  after(:all) do
    Dir.glob(File.join(TMPDIR, "dvdprofiler_profile_spec*")).each { |filename| File.delete(filename) }
  end

  it "should find by imdb_id" do
    @profile.should_not == nil
  end

  it "should find by title" do
    profile = DvdprofilerProfile.first(:titles => ['National Treasure: Book of Secrets'])
    profile.should_not == nil
  end

  it "should be able to convert to xml and then from xml" do
    hash = nil
    begin
      xml = @profile.to_xml
      hash = XmlSimple.xml_in(xml)
    rescue
      hash = nil
    end
    hash.should_not be_nil
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
royw-dvdprofiler2xbmc-0.0.6 spec/dvdprofiler_profile_spec.rb