Sha256: 50e9fc2e302a7e21204eab959629b8f67fc4a3e727e468efc826bf6db511b2f0

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

# encoding: UTF-8
require File.dirname(__FILE__) + '/test_helper.rb'

#
# test class for the TextfileEpisodeInfo plugin that
# searches for textfiles with suitable episode
# information
#
class TestPluginTextfile < Test::Unit::TestCase
    @@valid_directories = {
        'hmym'  => 'test/testfiles/HMMG.705',
    }

    def setup
        system('rm -r test/testfiles/*')

        d = @@valid_directories["hmym"]
        FileUtils.mkdir(d)
        FileUtils.touch(File.join(d, 'episode.avi'))

        filenametxt = File.new(File.join(d, "filename.txt"), "w")
        filenametxt.write("How.I.Met.Your.Mother.S07E05.Die.Exkursion.German.Dubbed.HDTV.XviD-ITG")
        filenametxt.close
    end

    def test_information_extraction
        how = Serienrenamer::Episode.new(@@valid_directories['hmym'])
        data = Plugin::Textfile.generate_episode_information(how)[0]
        how.add_episode_information(data, true)
        assert_equal("S07E05 - Die Exkursion.avi", how.to_s)
    end

    def test_information_extraction_with_directory_parameter
        how = @@valid_directories['hmym']
        data = Plugin::Textfile.generate_episode_information(how)[0]
        assert_not_nil(data)
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
serienrenamer-0.0.3 test/test_plugin_textfile.rb
serienrenamer-0.0.2 test/test_plugin_textfile.rb
serienrenamer-0.0.1 test/test_plugin_textfile.rb