1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-24 01:11:12 +00:00

cleanup: rubocop: fix Layout/MultilineHashBraceLayout in test/unit/lib/redmine/mime_type_test.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@19281 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2019-11-24 16:46:47 +00:00
parent 1bc6d701c9
commit 84852c2eb5

View File

@ -21,10 +21,11 @@ require File.expand_path('../../../../test_helper', __FILE__)
class Redmine::MimeTypeTest < ActiveSupport::TestCase
def test_of
to_test = {'test.txt' => 'text/plain',
'test.c' => 'text/x-c',
'TEST.JPG' => 'image/jpeg',
}
to_test = {
'test.txt' => 'text/plain',
'test.c' => 'text/x-c',
'TEST.JPG' => 'image/jpeg',
}
to_test.each do |name, expected|
assert_equal expected, Redmine::MimeType.of(name)
end
@ -35,10 +36,11 @@ class Redmine::MimeTypeTest < ActiveSupport::TestCase
end
def test_css_class_of
to_test = {'test.txt' => 'text-plain',
'test.c' => 'text-x-c',
'TEST.JPG' => 'image-jpeg',
}
to_test = {
'test.txt' => 'text-plain',
'test.c' => 'text-x-c',
'TEST.JPG' => 'image-jpeg',
}
to_test.each do |name, expected|
assert_equal expected, Redmine::MimeType.css_class_of(name)
end
@ -49,10 +51,11 @@ class Redmine::MimeTypeTest < ActiveSupport::TestCase
end
def test_main_mimetype_of
to_test = {'test.txt' => 'text',
'test.c' => 'text',
'TEST.JPG' => 'image',
}
to_test = {
'test.txt' => 'text',
'test.c' => 'text',
'TEST.JPG' => 'image',
}
to_test.each do |name, expected|
assert_equal expected, Redmine::MimeType.main_mimetype_of(name)
end
@ -63,11 +66,12 @@ class Redmine::MimeTypeTest < ActiveSupport::TestCase
end
def test_is_type
to_test = {['text', 'test.unk'] => false,
['text', 'test.txt'] => true,
['text', 'test.c'] => true,
['image', 'TEST.JPG'] => true,
}
to_test = {
['text', 'test.unk'] => false,
['text', 'test.txt'] => true,
['text', 'test.c'] => true,
['image', 'TEST.JPG'] => true,
}
to_test.each do |args, expected|
assert_equal expected, Redmine::MimeType.is_type?(*args)
end