Fix ameba complaints

This commit is contained in:
syeopite 2025-04-10 00:39:29 -07:00
parent 7901906092
commit 8be9d85d51
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A
3 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ Lint/NotNil:
Lint/SpecFilename:
Excluded:
- spec/parsers_helper.cr
- spec/*_helper.cr
#

View File

@ -17,7 +17,7 @@ require "db"
require "pg"
require "spectator"
require "../../load_config"
require "../../load_config_helper"
require "../../../src/invidious/helpers/crystal_class_overrides"
require "../../../src/invidious/connection/*"
@ -55,15 +55,15 @@ Spectator.describe Invidious::ConnectionPool do
it "Can make streaming requests" do
pool = Invidious::ConnectionPool::Pool.new(max_capacity: 100) { next make_client(TEST_SERVER_URL) }
expect(pool.get("/get") { |r| r.body_io.gets_to_end }).to eq("get")
expect(pool.get("/post") { |r| r.body }).to eq("")
expect(pool.post("/post") { |r| r.body_io.gets_to_end }).to eq("post")
expect(pool.get("/get", &.body_io.gets_to_end)).to eq("get")
expect(pool.get("/post", &.body)).to eq("")
expect(pool.post("/post", &.body_io.gets_to_end)).to eq("post")
end
it "Allows more than one clients to be checked out (if applicable)" do
pool = Invidious::ConnectionPool::Pool.new(max_capacity: 100) { next make_client(TEST_SERVER_URL) }
pool.checkout do |client|
pool.checkout do |_|
expect(pool.post("/post").body).to eq("post")
end
end