Sha256: 39da307ead23d2171984df9497ea4e05dc0bd9442051c09ed3278a03a154c3f4

Contents?: true

Size: 1.06 KB

Versions: 23

Compression:

Stored size: 1.06 KB

Contents

require File.expand_path(File.dirname(__FILE__)) + '/helper'

class FormatDetectorTest < 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 "Nuke .nk script file", 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

23 entries across 23 versions & 1 rubygems

Version Path
tracksperanto-2.8.6 test/test_format_detector.rb
tracksperanto-2.8.5 test/test_format_detector.rb
tracksperanto-2.8.4 test/test_format_detector.rb
tracksperanto-2.8.2 test/test_format_detector.rb
tracksperanto-2.8.1 test/test_format_detector.rb
tracksperanto-2.8.0 test/test_format_detector.rb
tracksperanto-2.7.0 test/test_format_detector.rb
tracksperanto-2.6.3 test/test_format_detector.rb
tracksperanto-2.6.2 test/test_format_detector.rb
tracksperanto-2.6.1 test/test_format_detector.rb
tracksperanto-2.6.0 test/test_format_detector.rb
tracksperanto-2.5.0 test/test_format_detector.rb
tracksperanto-2.4.1 test/test_format_detector.rb
tracksperanto-2.3.3 test/test_format_detector.rb
tracksperanto-2.3.2 test/test_format_detector.rb
tracksperanto-2.3.1 test/test_format_detector.rb
tracksperanto-2.3.0 test/test_format_detector.rb
tracksperanto-2.2.4 test/test_format_detector.rb
tracksperanto-2.2.2 test/test_format_detector.rb
tracksperanto-2.2.0 test/test_format_detector.rb