From 57b7f3940d3d7495f0eb179a3add9930fd050ff1 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 21 Mar 2024 19:30:17 -0400 Subject: [PATCH] test/abstract_command_spec: rename `cat` to fix completions test Signed-off-by: Michael Cho --- Library/Homebrew/test/abstract_command_spec.rb | 14 +++++++------- Library/Homebrew/test/abstract_command_spec.rbi | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/test/abstract_command_spec.rb b/Library/Homebrew/test/abstract_command_spec.rb index 0b3b5e05a4..99075ef269 100644 --- a/Library/Homebrew/test/abstract_command_spec.rb +++ b/Library/Homebrew/test/abstract_command_spec.rb @@ -5,37 +5,37 @@ require "abstract_command" RSpec.describe Homebrew::AbstractCommand do describe "subclasses" do before do - cat = Class.new(described_class) do + test_cat = Class.new(described_class) do cmd_args do switch "--foo" flag "--bar=" end def run; end end - stub_const("Cat", cat) + stub_const("TestCat", test_cat) end describe "parsing args" do it "parses valid args" do - expect { Cat.new(["--foo"]).run }.not_to raise_error + expect { TestCat.new(["--foo"]).run }.not_to raise_error end it "allows access to args" do - expect(Cat.new(["--bar", "baz"]).args[:bar]).to eq("baz") + expect(TestCat.new(["--bar", "baz"]).args[:bar]).to eq("baz") end it "raises on invalid args" do - expect { Cat.new(["--bat"]) }.to raise_error(OptionParser::InvalidOption) + expect { TestCat.new(["--bat"]) }.to raise_error(OptionParser::InvalidOption) end end describe "command names" do it "has a default command name" do - expect(Cat.command_name).to eq("cat") + expect(TestCat.command_name).to eq("test-cat") end it "can lookup command" do - expect(described_class.command("cat")).to be(Cat) + expect(described_class.command("test-cat")).to be(TestCat) end describe "when command name is overridden" do diff --git a/Library/Homebrew/test/abstract_command_spec.rbi b/Library/Homebrew/test/abstract_command_spec.rbi index f282e9a02f..67822934d5 100644 --- a/Library/Homebrew/test/abstract_command_spec.rbi +++ b/Library/Homebrew/test/abstract_command_spec.rbi @@ -1,4 +1,4 @@ # typed: strict -class Cat < Homebrew::AbstractCommand; end +class TestCat < Homebrew::AbstractCommand; end class Tac < Homebrew::AbstractCommand; end