From 8be9d85d51301c935f5bfc2367565e63b4eba460 Mon Sep 17 00:00:00 2001 From: syeopite Date: Thu, 10 Apr 2025 00:39:29 -0700 Subject: [PATCH] Fix ameba complaints --- .ameba.yml | 2 +- spec/helpers/networking/connection_pool_spec.cr | 10 +++++----- spec/{load_config.cr => load_config_helper.cr} | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename spec/{load_config.cr => load_config_helper.cr} (100%) diff --git a/.ameba.yml b/.ameba.yml index 36d7c48f..e9e67b16 100644 --- a/.ameba.yml +++ b/.ameba.yml @@ -25,7 +25,7 @@ Lint/NotNil: Lint/SpecFilename: Excluded: - - spec/parsers_helper.cr + - spec/*_helper.cr # diff --git a/spec/helpers/networking/connection_pool_spec.cr b/spec/helpers/networking/connection_pool_spec.cr index 506cba6a..3209d4e3 100644 --- a/spec/helpers/networking/connection_pool_spec.cr +++ b/spec/helpers/networking/connection_pool_spec.cr @@ -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 diff --git a/spec/load_config.cr b/spec/load_config_helper.cr similarity index 100% rename from spec/load_config.cr rename to spec/load_config_helper.cr