mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Lock to mime types 1.15
This commit is contained in:
@@ -3,5 +3,5 @@ Gem::Specification.new do |s|
|
||||
s.version = '0.0.1'
|
||||
s.summary = "GitHub Language detection"
|
||||
|
||||
s.add_dependency 'mime-types'
|
||||
s.add_dependency 'mime-types', '1.15'
|
||||
end
|
||||
|
||||
@@ -6,9 +6,9 @@ class TestMime < Test::Unit::TestCase
|
||||
include Linguist
|
||||
|
||||
def test_lookup
|
||||
assert_equal 'application/ruby', Mime.lookup(".rb")
|
||||
assert_equal 'application/javascript', Mime.lookup(".js")
|
||||
assert_equal 'application/python', Mime.lookup(".py")
|
||||
assert_equal 'text/plain; charset=utf-8', Mime.lookup(".rb")
|
||||
assert_equal 'text/plain; charset=utf-8', Mime.lookup(".js")
|
||||
assert_equal 'text/plain; charset=utf-8', Mime.lookup(".py")
|
||||
|
||||
assert_equal 'text/plain; charset=utf-8', Mime.lookup(".kt")
|
||||
assert_equal 'text/plain; charset=utf-8', Mime.lookup(".html")
|
||||
|
||||
@@ -52,14 +52,14 @@ class TestPathname < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_mime_type
|
||||
assert_equal 'application/ruby', Pathname.new("file.rb").mime_type
|
||||
assert_equal 'application/javascript', Pathname.new("file.js").mime_type
|
||||
assert_equal 'application/python', Pathname.new("itty.py").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
|
||||
end
|
||||
|
||||
def test_media_type
|
||||
assert_equal 'application', Pathname.new("file.js").media_type
|
||||
assert_equal 'text', Pathname.new("file.js").media_type
|
||||
assert_equal 'text', Pathname.new("file.txt").media_type
|
||||
assert_equal 'text', Pathname.new("defun.kt").media_type
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user