From 6d464627681ebb28669d036581f520621d051fc6 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Mon, 15 Nov 2021 13:41:25 -0500 Subject: [PATCH] Standardrb fixup --- lib/mime/types.rb | 4 ++-- test/test_mime_types.rb | 10 +++++----- test/test_mime_types_class.rb | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/mime/types.rb b/lib/mime/types.rb index 0227810..8bdab63 100644 --- a/lib/mime/types.rb +++ b/lib/mime/types.rb @@ -151,8 +151,8 @@ def [](type_id, complete: false, registered: false) def type_for(filename) results = Array(filename).flat_map { |fn| - @extension_index[fn.chomp.downcase[/\.?([^.]*?)$/, 1]] - }.compact.inject(Set.new, :+) + @extension_index[fn.chomp.downcase[/\.?([^.]*?)$/, 1]] + }.compact.inject(Set.new, :+) stable_sort(results) end diff --git a/test/test_mime_types.rb b/test/test_mime_types.rb index 597f0e9..44f3736 100644 --- a/test/test_mime_types.rb +++ b/test/test_mime_types.rb @@ -38,7 +38,7 @@ def mime_types assert_kind_of Enumerator::Lazy, mime_types.map.lazy end - it 'is countable with an enumerator' do + it "is countable with an enumerator" do assert_equal 8, mime_types.each.count assert_equal 8, mime_types.lazy.count end @@ -161,13 +161,13 @@ def mime_types assert_includes mime_types.type_for("xtxt"), "text/plain" end - it 'returns a stable order for types with equal priority' do - assert_equal %w(audio/webm video/webm), mime_types.type_for('foo.webm') + it "returns a stable order for types with equal priority" do + assert_equal %w[audio/webm video/webm], mime_types.type_for("foo.webm") end end - describe '#count' do - it 'can count the number of types inside' do + describe "#count" do + it "can count the number of types inside" do assert_equal 8, mime_types.count end end diff --git a/test/test_mime_types_class.rb b/test/test_mime_types_class.rb index 84fff6f..d82bfe4 100644 --- a/test/test_mime_types_class.rb +++ b/test/test_mime_types_class.rb @@ -101,8 +101,8 @@ def setup assert_includes MIME::Types.type_for("xtxt"), "text/plain" end - it 'returns a stable order for types with equal priority' do - assert_equal %w(audio/webm video/webm), MIME::Types.type_for('foo.webm') + it "returns a stable order for types with equal priority" do + assert_equal %w[audio/webm video/webm], MIME::Types.type_for("foo.webm") end end