diff options
author | Al Snow <jasnow@hotmail.com> | 2019-12-26 14:37:02 -0500 |
---|---|---|
committer | Austin Ziegler <austin@zieglers.ca> | 2019-12-26 14:37:02 -0500 |
commit | c44673179d24e495e5fb93282a87d37f09925d25 (patch) | |
tree | ecc4c30d9b8ee5c20ac3ad97392b63da2c3c2e16 /test | |
parent | 178745421b7a0664bf7ff33885c3fb38b6597fb7 (diff) | |
download | mime-types-c44673179d24e495e5fb93282a87d37f09925d25.tar.gz |
Fix [_1,_2,_3] parameters (conflict with Ruby 2.7.0); Updated gems and ruby versions.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_mime_type.rb | 18 | ||||
-rw-r--r-- | test/test_mime_types.rb | 28 | ||||
-rw-r--r-- | test/test_mime_types_class.rb | 4 | ||||
-rw-r--r-- | test/test_mime_types_loader.rb | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/test/test_mime_type.rb b/test/test_mime_type.rb index feae3f9..891c04e 100644 --- a/test/test_mime_type.rb +++ b/test/test_mime_type.rb @@ -46,15 +46,15 @@ describe MIME::Type do it 'does not remove x- prefixes by default' do assert_equal 'application/x-msword', - MIME::Type.simplified('application/x-msword') + MIME::Type.simplified('application/x-msword') assert_equal 'x-xyz/abc', MIME::Type.simplified('x-xyz/abc') end it 'removes x- prefixes when requested' do assert_equal 'application/msword', - MIME::Type.simplified('application/x-msword', remove_x_prefix: true) + MIME::Type.simplified('application/x-msword', remove_x_prefix: true) assert_equal 'xyz/abc', - MIME::Type.simplified('x-xyz/abc', remove_x_prefix: true) + MIME::Type.simplified('x-xyz/abc', remove_x_prefix: true) end it 'lowercases mixed-case types' do @@ -73,7 +73,7 @@ describe MIME::Type do it 'does not remove x-prefixes' do assert_equal 'application.x-msword', - MIME::Type.i18n_key('application/x-msword') + MIME::Type.i18n_key('application/x-msword') end it 'converts text/vCard to text.vcard' do @@ -436,12 +436,12 @@ describe MIME::Type do it 'has the extensions key if set' do assert_has_keys mime_type(t) { |v| v.extensions = 'a' }.to_h, - 'extensions' + 'extensions' end it 'has the preferred-extension key if set' do assert_has_keys mime_type(t) { |v| v.preferred_extension = 'a' }.to_h, - 'preferred-extension' + 'preferred-extension' end it 'has the obsolete key if set' do @@ -472,7 +472,7 @@ describe MIME::Type do describe '#to_s, #to_str' do it 'represents itself as a string of the canonical content_type' do - assert_equal 'text/plain', "#{text_plain}" # rubocop:disable Style/UnneededInterpolation + assert_equal 'text/plain', text_plain.to_s end it 'acts like a string of the canonical content_type for comparison' do @@ -587,7 +587,7 @@ describe MIME::Type do assert_equal expected, text_plain.friendly(['en', 'Text files']) expected.update('fr' => 'des fichiers texte') assert_equal expected, - text_plain.friendly(['fr', 'des fichiers texte']) + text_plain.friendly(['fr', 'des fichiers texte']) end it 'merges new values from a hash parameter' do @@ -604,7 +604,7 @@ describe MIME::Type do end assert_equal 'Expected a language or translation set, not 1', - exception.message + exception.message end end end diff --git a/test/test_mime_types.rb b/test/test_mime_types.rb index f8b1a0b..6a9689f 100644 --- a/test/test_mime_types.rb +++ b/test/test_mime_types.rb @@ -7,18 +7,18 @@ describe MIME::Types do def mime_types @mime_types ||= MIME::Types.new.tap { |mt| mt.add MIME::Type.new(['text/plain', %w(txt)]), - MIME::Type.new(['image/jpeg', %w(jpg jpeg)]), - MIME::Type.new('application/x-wordperfect6.1'), - MIME::Type.new( - 'content-type' => 'application/x-www-form-urlencoded', - 'registered' => true - ), - MIME::Type.new(['application/x-gzip', %w(gz)]), - MIME::Type.new( - 'content-type' => 'application/gzip', - 'extensions' => 'gz', - 'registered' => true - ) + MIME::Type.new(['image/jpeg', %w(jpg jpeg)]), + MIME::Type.new('application/x-wordperfect6.1'), + MIME::Type.new( + 'content-type' => 'application/x-www-form-urlencoded', + 'registered' => true + ), + MIME::Type.new(['application/x-gzip', %w(gz)]), + MIME::Type.new( + 'content-type' => 'application/gzip', + 'extensions' => 'gz', + 'registered' => true + ) } end @@ -136,7 +136,7 @@ describe MIME::Types do describe '#type_for' do it 'finds all types for a given extension' do assert_equal %w(application/gzip application/x-gzip), - mime_types.type_for('gz') + mime_types.type_for('gz') end it 'separates the extension from filenames' do @@ -145,7 +145,7 @@ describe MIME::Types do it 'finds multiple extensions' do assert_equal %w(image/jpeg text/plain), - mime_types.type_for(%w(foo.txt foo.jpeg)) + mime_types.type_for(%w(foo.txt foo.jpeg)) end it 'does not find unknown extensions' do diff --git a/test/test_mime_types_class.rb b/test/test_mime_types_class.rb index 418678a..a9f4468 100644 --- a/test/test_mime_types_class.rb +++ b/test/test_mime_types_class.rb @@ -79,7 +79,7 @@ describe MIME::Types, 'registry' do describe '.type_for' do it 'finds all types for a given extension' do assert_equal %w(application/gzip application/x-gzip), - MIME::Types.type_for('gz') + MIME::Types.type_for('gz') end it 'separates the extension from filenames' do @@ -88,7 +88,7 @@ describe MIME::Types, 'registry' do it 'finds multiple extensions' do assert_equal %w(image/jpeg text/plain), - MIME::Types.type_for(%w(foo.txt foo.jpeg)) + MIME::Types.type_for(%w(foo.txt foo.jpeg)) end it 'does not find unknown extensions' do diff --git a/test/test_mime_types_loader.rb b/test/test_mime_types_loader.rb index 3f3206a..7fb4e9b 100644 --- a/test/test_mime_types_loader.rb +++ b/test/test_mime_types_loader.rb @@ -16,7 +16,7 @@ describe MIME::Types::Loader do refute(types['audio/webm'].first.registered?) assert_equal('Fixes a bug with IE6 and progressive JPEGs', - types['image/pjpeg'].first.docs) + types['image/pjpeg'].first.docs) assert(types['audio/vnd.qcelp'].first.obsolete?) assert_equal('audio/QCELP', types['audio/vnd.qcelp'].first.use_instead) |