File: magic_and_name_test.rb

package info (click to toggle)
ruby-marcel 1.0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,744 kB
  • sloc: xml: 7,041; ruby: 536; makefile: 7; javascript: 3
file content (13 lines) | stat: -rw-r--r-- 581 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'test_helper'
require 'rack'

class Marcel::MimeType::MagicAndNameTest < Marcel::TestCase
  # All fixtures that can be recognised by name should also be recognisable when given
  # the file contents and the name. In some cases, the file contents will point to a
  # generic type, while the name will choose a more specific subclass
  each_content_type_fixture('name') do |file, name, content_type|
    test "correctly returns #{content_type} for #{name} given both file and name" do
      assert_equal content_type, Marcel::MimeType.for(file, name: name)
    end
  end
end