Sha256: 43cb6efd9692bb541b5976ca118aa0e55cb8af25a533c6715cfdee2650220279

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

# -*- encoding : utf-8 -*-
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

5 entries across 5 versions & 1 rubygems

Version Path
tracksperanto-2.9.4 test/test_format_detector.rb
tracksperanto-2.9.3 test/test_format_detector.rb
tracksperanto-2.9.2 test/test_format_detector.rb
tracksperanto-2.9.1 test/test_format_detector.rb
tracksperanto-2.9.0 test/test_format_detector.rb