Split mime type and content type

This commit is contained in:
Joshua Peek
2011-05-20 11:24:32 -05:00
parent 0f0f6d282b
commit 0651355e71
7 changed files with 83 additions and 45 deletions

View File

@@ -61,10 +61,16 @@ class TestPathname < Test::Unit::TestCase
end
def test_mime_type
assert_equal 'text/plain; charset=utf-8', Pathname.new("file.rb").mime_type
assert_equal 'text/plain; charset=utf-8', Pathname.new("file.js").mime_type
assert_equal 'text/plain; charset=utf-8', Pathname.new("itty.py").mime_type
assert_equal 'text/plain; charset=utf-8', Pathname.new("defun.kt").mime_type
assert_equal 'text/plain', Pathname.new("file.rb").mime_type
assert_equal 'text/plain', Pathname.new("file.js").mime_type
assert_equal 'text/plain', Pathname.new("itty.py").mime_type
assert_equal 'text/plain', Pathname.new("defun.kt").mime_type
end
def test_content_type
assert_equal 'text/plain; charset=utf-8', Pathname.new("file.txt").content_type
assert_equal 'text/plain; charset=utf-8', Pathname.new("file.rb").content_type
assert_equal 'image/png', Pathname.new("octocat.png").content_type
end
def test_media_type