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.5.9 test/test_format_detector.rb
tracksperanto-3.5.8 test/test_format_detector.rb
tracksperanto-3.5.7 test/test_format_detector.rb
tracksperanto-3.5.6 test/test_format_detector.rb
tracksperanto-3.5.5 test/test_format_detector.rb
tracksperanto-3.5.4 test/test_format_detector.rb
tracksperanto-3.5.2 test/test_format_detector.rb
tracksperanto-3.5.1 test/test_format_detector.rb
tracksperanto-3.5.0 test/test_format_detector.rb
tracksperanto-3.4.1 test/test_format_detector.rb
tracksperanto-3.4.0 test/test_format_detector.rb
tracksperanto-3.3.13 test/test_format_detector.rb
tracksperanto-3.3.12 test/test_format_detector.rb
tracksperanto-3.3.11 test/test_format_detector.rb
tracksperanto-3.3.10 test/test_format_detector.rb
tracksperanto-3.3.9 test/test_format_detector.rb
tracksperanto-3.3.8 test/test_format_detector.rb
tracksperanto-3.3.7 test/test_format_detector.rb
tracksperanto-3.3.6 test/test_format_detector.rb
tracksperanto-3.3.0.pre test/test_format_detector.rb