From 1db309f0247b44af2b9a312d4f3924b622f5f72e Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 21 Mar 2024 14:02:42 -0700 Subject: [PATCH] Fix typo'd class name --- .../Homebrew/dev-cmd/bump-unversioned-casks.rb | 2 +- Library/Homebrew/test/abstract_command_spec.rb | 17 +++++++++++++++++ .../test/dev-cmd/bump-unversioned-casks_spec.rb | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb index 15faafce133b2..47d064ed649a8 100644 --- a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb +++ b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb @@ -12,7 +12,7 @@ module Homebrew module DevCmd - class BumpUnversionedCask < AbstractCommand + class BumpUnversionedCasks < AbstractCommand include SystemCommand::Mixin cmd_args do diff --git a/Library/Homebrew/test/abstract_command_spec.rb b/Library/Homebrew/test/abstract_command_spec.rb index 0b3b5e05a4676..01884dd62c549 100644 --- a/Library/Homebrew/test/abstract_command_spec.rb +++ b/Library/Homebrew/test/abstract_command_spec.rb @@ -53,4 +53,21 @@ def run; end end end end + + describe "command paths" do + it "match command name" do + # Ensure all commands are loaded + ["cmd", "dev-cmd"].each do |dir| + Dir[File.join(__dir__, "../#{dir}", "*.rb")].each { require(_1) } + end + test_classes = ["Cat", "Tac"] + + described_class.subclasses.each do |klass| + next if test_classes.include?(klass.name) + + dir = klass.name.start_with?("Homebrew::DevCmd") ? "dev-cmd" : "cmd" + expect(Pathname(File.join(__dir__, "../#{dir}/#{klass.command_name}.rb"))).to exist + end + end + end end diff --git a/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb b/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb index a7ab01f2c22e4..f6c6936307bb1 100644 --- a/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb @@ -3,6 +3,6 @@ require "cmd/shared_examples/args_parse" require "dev-cmd/bump-unversioned-casks" -RSpec.describe Homebrew::DevCmd::BumpUnversionedCask do +RSpec.describe Homebrew::DevCmd::BumpUnversionedCasks do it_behaves_like "parseable arguments", argv: ["foo"] end