Sha256: ac74f67aa67ff92dc540f7d0023c1fd571707c0490b6525ba92f47e8868988cd

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

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

class TestBlacklist < Test::Unit::TestCase
  
  def test_non_blacklisted_formats
    %w( file.txt file.2dt file.stabilizer ).each do | filename |
      Tracksperanto::Blacklist.raise_if_format_unsupported(filename)
    end
    assert true, 'No exceptions should have been raised'
  end
  
  def test_blacklisted_formats
    %w(
      file.jpg
      file.tif
      file.tiff
      file.mov
      file.r3d
      file.dpx
      file.jpg
      file.gif
      file.PNG
      file.sni
      file.ma
      file.mb
      file.ptp
      file.pfb
      file.pfmp
      file.mmf
      file.doc
      file.docx
      file.ppt
      file.pptx
      file.xls
      file.xlsx
      file.fbx
      file.abc
      file.3de
      file.bpj
      file.py
      file.ascii
      file.c4d
    ).each do | filename |
      error = assert_raise(Tracksperanto::UnsupportedFormatError, "Should fail for #{filename.inspect}") do
        Tracksperanto::Blacklist.raise_if_format_unsupported(filename)
      end
      assert_operator error.message.length, :>, 5, 'Should contain a descriptive error message'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 test/test_blacklist.rb