Sha256: c151e2d89b0eff9aad7f45e67705b6b4712db4f63a7b9cc36b9b78c64d564135

Contents?: true

Size: 1.05 KB

Versions: 48

Compression:

Stored size: 1.05 KB

Contents

require 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

48 entries across 48 versions & 1 rubygems

Version Path
tracksperanto-1.7.0 test/test_format_detector.rb
tracksperanto-1.6.9 test/test_format_detector.rb
tracksperanto-1.6.8 test/test_format_detector.rb
tracksperanto-1.6.7 test/test_format_detector.rb
tracksperanto-1.6.6 test/test_format_detector.rb
tracksperanto-1.6.5 test/test_format_detector.rb
tracksperanto-1.6.4 test/test_format_detector.rb
tracksperanto-1.6.3 test/test_format_detector.rb
tracksperanto-1.6.2 test/test_format_detector.rb
tracksperanto-1.6.1 test/test_format_detector.rb
tracksperanto-1.6.0 test/test_format_detector.rb
tracksperanto-1.5.7 test/test_format_detector.rb
tracksperanto-1.5.6 test/test_format_detector.rb
tracksperanto-1.5.5 test/test_format_detector.rb
tracksperanto-1.5.4 test/test_format_detector.rb
tracksperanto-1.5.3 test/test_format_detector.rb
tracksperanto-1.5.2 test/test_format_detector.rb
tracksperanto-1.5.1 test/test_format_detector.rb
tracksperanto-1.5.0 test/test_format_detector.rb
tracksperanto-1.4.0 test/test_format_detector.rb