From 57c09f085548ce99125d17062ba9efdb2235bf05 Mon Sep 17 00:00:00 2001 From: LanikSJ Date: Sun, 5 Nov 2023 21:20:32 -0800 Subject: [PATCH 1/2] Add Conflicts for LSUSB --- Formula/lsusb-plus.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Formula/lsusb-plus.rb b/Formula/lsusb-plus.rb index b420139..6559a73 100644 --- a/Formula/lsusb-plus.rb +++ b/Formula/lsusb-plus.rb @@ -6,6 +6,9 @@ class LsusbPlus < Formula license "MIT" head "https://github.com/LanikSJ/lsusb", using: :git + conflicts_with "lsusb", because: "both provide an `lsusb` binary" + conflicts_with "usbutils", because: "both provide an `lsusb` binary" + def install bin.install "lsusb" man8.install "man/lsusb.8" From 534fcbb9f0a5382923a459115539c76d1947e026 Mon Sep 17 00:00:00 2001 From: LanikSJ Date: Sun, 5 Nov 2023 21:27:48 -0800 Subject: [PATCH 2/2] Add Tests and Depends On --- Formula/lsusb-plus.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Formula/lsusb-plus.rb b/Formula/lsusb-plus.rb index 6559a73..668b44a 100644 --- a/Formula/lsusb-plus.rb +++ b/Formula/lsusb-plus.rb @@ -6,6 +6,8 @@ class LsusbPlus < Formula license "MIT" head "https://github.com/LanikSJ/lsusb", using: :git + depends_on :macos + conflicts_with "lsusb", because: "both provide an `lsusb` binary" conflicts_with "usbutils", because: "both provide an `lsusb` binary" @@ -13,4 +15,9 @@ def install bin.install "lsusb" man8.install "man/lsusb.8" end + + test do + output = shell_output("#{bin}/lsusb") + assert_match(/^Bus [0-9]+ Device [0-9]+:/, output) + end end