Port Homebrew::Cmd::Doctor
This commit is contained in:
parent
67fd065e1d
commit
f83ba58f8d
@ -1,14 +1,14 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "abstract_command"
|
||||
require "diagnostic"
|
||||
require "cli/parser"
|
||||
require "cask/caskroom"
|
||||
|
||||
module Homebrew
|
||||
sig { returns(CLI::Parser) }
|
||||
def self.doctor_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
module Cmd
|
||||
class Doctor < AbstractCommand
|
||||
cmd_args do
|
||||
description <<~EOS
|
||||
Check your system for potential problems. Will exit with a non-zero status
|
||||
if any potential problems are found.
|
||||
@ -25,12 +25,10 @@ module Homebrew
|
||||
|
||||
named_args :diagnostic_check
|
||||
end
|
||||
end
|
||||
|
||||
def self.doctor
|
||||
args = doctor_args.parse
|
||||
|
||||
inject_dump_stats!(Diagnostic::Checks, /^check_*/) if args.audit_debug?
|
||||
sig { override.void }
|
||||
def run
|
||||
Homebrew.inject_dump_stats!(Diagnostic::Checks, /^check_*/) if args.audit_debug?
|
||||
|
||||
checks = Diagnostic::Checks.new(verbose: args.verbose?)
|
||||
|
||||
@ -77,4 +75,6 @@ module Homebrew
|
||||
|
||||
puts "Your system is ready to brew." if !Homebrew.failed? && !args.quiet?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cmd/doctor"
|
||||
require "cmd/shared_examples/args_parse"
|
||||
|
||||
RSpec.describe "brew doctor" do
|
||||
RSpec.describe Homebrew::Cmd::Doctor do
|
||||
it_behaves_like "parseable arguments"
|
||||
|
||||
specify "check_integration_test", :integration_test do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user