Sha256: 72ba81418be2cf31e9736936f7b7ddbe0e9dacfce8123907d08089542fd5ed7c

Contents?: true

Size: 1.11 KB

Versions: 36

Compression:

Stored size: 1.11 KB

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__)) + '/helper'

class TestFormatDetector < Test::Unit::TestCase
  
  def test_match_unknown
    file = "/tmp/unknown.someext"
    d = Tracksperanto::FormatDetector.new(file)
    
    assert d.frozen?
    assert !d.match?
    assert !d.auto_size?
    assert_nil d.importer_klass
    assert_equal "Unknown format", d.human_importer_name
  end
  
  
  def test_match_nuke
    file = "C:\\WINDOZE_SHIT\\SUPERDUPER.NK"
    d = Tracksperanto::FormatDetector.new(file)
    assert d.frozen?
    
    assert d.match?
    assert !d.auto_size?
    assert_equal Tracksperanto::Import::NukeScript, d.importer_klass
    assert_equal Tracksperanto::Import::NukeScript.human_name, d.human_importer_name
  end
  
  def test_match_flame
    file = "/usr/discreet/project/StupidCommercial/stabilizer/uno.stabilizer"
    d = Tracksperanto::FormatDetector.new(file)
    assert d.frozen?
    
    assert d.match?
    assert d.auto_size?
    assert_equal Tracksperanto::Import::FlameStabilizer, d.importer_klass
    assert_equal "Flame .stabilizer file", d.human_importer_name
  end
  
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
tracksperanto-3.2.2 test/test_format_detector.rb
tracksperanto-3.2.1 test/test_format_detector.rb
tracksperanto-3.2.0 test/test_format_detector.rb
tracksperanto-3.1.0 test/test_format_detector.rb
tracksperanto-3.0.1 test/test_format_detector.rb
tracksperanto-3.0.0 test/test_format_detector.rb
tracksperanto-2.12.0 test/test_format_detector.rb
tracksperanto-2.11.3 test/test_format_detector.rb
tracksperanto-2.11.2 test/test_format_detector.rb
tracksperanto-2.11.1 test/test_format_detector.rb
tracksperanto-2.11.0 test/test_format_detector.rb
tracksperanto-2.10.0 test/test_format_detector.rb
tracksperanto-2.9.9 test/test_format_detector.rb
tracksperanto-2.9.8 test/test_format_detector.rb
tracksperanto-2.9.7 test/test_format_detector.rb
tracksperanto-2.9.6 test/test_format_detector.rb