Sha256: 745a9d1b74c4e0f14f145fb3285e20764d32d9a33935f56dba8b5f5c7447778e

Contents?: true

Size: 950 Bytes

Versions: 55

Compression:

Stored size: 950 Bytes

Contents

# -*- ruby encoding: utf-8 -*-

require 'mime/types'
require 'minitest_helper'

describe MIME::Types::Loader do
  def setup
    @path     = File.expand_path('../fixture', __FILE__)
    @loader   = MIME::Types::Loader.new(@path)
    @bad_path = File.expand_path('../bad-fixtures', __FILE__)
  end

  def assert_correctly_loaded(types)
    assert_includes(types, 'application/1d-interleaved-parityfec')
    assert_equal(%w(webm), types['audio/webm'].first.extensions)
    refute(types['audio/webm'].first.registered?)

    assert_equal('Fixes a bug with IE6 and progressive JPEGs',
                 types['image/pjpeg'].first.docs)

    assert(types['audio/vnd.qcelp'].first.obsolete?)
    assert_equal('audio/QCELP', types['audio/vnd.qcelp'].first.use_instead)
  end

  it 'loads YAML files correctly' do
    assert_correctly_loaded @loader.load_yaml
  end

  it 'loads JSON files correctly' do
    assert_correctly_loaded @loader.load_json
  end
end

Version data entries

55 entries across 51 versions & 9 rubygems

Version Path
kinetic_sdk-5.0.2.beta.2 gems/mime-types-3.1/test/test_mime_types_loader.rb
kinetic_sdk-5.0.2.beta.1 gems/mime-types-3.1/test/test_mime_types_loader.rb
kinetic_sdk-5.0.1 gems/mime-types-3.1/test/test_mime_types_loader.rb
kinetic_sdk-5.0.0 gems/mime-types-3.1/test/test_mime_types_loader.rb
kinetic_sdk-1.0.2 gems/mime-types-3.1/test/test_mime_types_loader.rb
kinetic_sdk-1.0.1 gems/mime-types-3.1/test/test_mime_types_loader.rb
kinetic_sdk-1.0.0 gems/mime-types-3.1/test/test_mime_types_loader.rb
kinetic_sdk-0.1.1 gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-unbundled-2.1.1.0 vendor/bundle/ruby/2.5.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-unbundled-2.0.4.0 vendor/bundle/ruby/2.5.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
tdiary-5.0.8 vendor/bundle/gems/mime-types-3.1/test/test_mime_types_loader.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-unbundled-2.0.3.0 vendor/bundle/ruby/2.5.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.5.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/mime-types-3.1/test/test_mime_types_loader.rb
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/gems/mime-types-3.1/test/test_mime_types_loader.rb