Skip to content

Commit

Permalink
Standardrb fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Feb 17, 2023
1 parent 78b50d4 commit 6d46462
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/mime/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions test/test_mime_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_mime_types_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6d46462

Please sign in to comment.