From 23336aa316a1bd0290e17b4ceb68c675ee83c8f9 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Fri, 15 Mar 2024 12:58:59 -0700 Subject: [PATCH] Update tests --- Library/Homebrew/abstract_command.rb | 8 ++++---- .../Homebrew/test/sorbet/tapioca/compilers/args_spec.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/abstract_command.rb b/Library/Homebrew/abstract_command.rb index 359bfb3f66..62af4697bf 100644 --- a/Library/Homebrew/abstract_command.rb +++ b/Library/Homebrew/abstract_command.rb @@ -15,8 +15,8 @@ module Homebrew abstract! class << self - sig { returns(T.nilable(T.proc.void)) } - attr_reader :parser_block + sig { returns(T.nilable(CLI::Parser)) } + attr_reader :parser sig { returns(String) } def command_name = T.must(name).split("::").fetch(-1).downcase @@ -29,7 +29,7 @@ module Homebrew sig { params(block: T.nilable(T.proc.bind(CLI::Parser).void)).void } def cmd_args(&block) - @parser_block = T.let(block, T.nilable(T.proc.void)) + @parser = T.let(CLI::Parser.new(&block), T.nilable(CLI::Parser)) end end @@ -40,7 +40,7 @@ module Homebrew sig { params(argv: T::Array[String]).void } def initialize(argv = ARGV.freeze) - @args = T.let(CLI::Parser.new(&self.class.parser_block).parse(argv), CLI::Args) + @args = T.let(T.must(self.class.parser).parse(argv), CLI::Args) end sig { abstract.void } diff --git a/Library/Homebrew/test/sorbet/tapioca/compilers/args_spec.rb b/Library/Homebrew/test/sorbet/tapioca/compilers/args_spec.rb index 631a80d2c8..321a32e08d 100644 --- a/Library/Homebrew/test/sorbet/tapioca/compilers/args_spec.rb +++ b/Library/Homebrew/test/sorbet/tapioca/compilers/args_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Tapioca::Compilers::Args do let(:compiler) { described_class.new(Tapioca::Dsl::Pipeline.new(requested_constants: []), RBI::Tree.new, Homebrew) } let(:list_parser) do require "cmd/list" - Homebrew.list_args + Homebrew::Cmd::List.parser end # good testing candidate, bc it has multiple for each of switch, flag, and comma_array args: let(:update_python_resources_parser) do