class TestIt < Formula
  desc "Workspace test aggregator with coverage"
  homepage "https://lmrr-cc.pages.dev/tools/test-it"
  version "0.1.0"
  license "MIT"

  on_macos do
    on_arm do
      url "https://lmrr-cc.pages.dev/releases/test-it/0.1.0/test-it-aarch64-apple-darwin.tar.gz"
      sha256 "6ae4717475b8b4ef58ca4434948f99c50f8cfc8b41e41575c995373e99d9fe4c"
    end
    on_intel do
      url "https://lmrr-cc.pages.dev/releases/test-it/0.1.0/test-it-x86_64-apple-darwin.tar.gz"
      sha256 "1719f7123eb86bec1a8e78343690330616832739cb4be23df0c49a53ff7838ed"
    end
  end

  on_linux do
    on_arm do
      url "https://lmrr-cc.pages.dev/releases/test-it/0.1.0/test-it-aarch64-unknown-linux-gnu.tar.gz"
      sha256 "fccf1725c3cf8e28a3a00905aad04f53a4cd99477f58d70a6c37fce28b0bb6f2"
    end
    on_intel do
      url "https://lmrr-cc.pages.dev/releases/test-it/0.1.0/test-it-x86_64-unknown-linux-gnu.tar.gz"
      sha256 "49f785f70a0777dca6201539778aa5a4eb133b2223a23e26d459f36ca0deb5d2"
    end
  end

  def install
    bin.install "test-it"
    bin.install "cargo-test-it"
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/test-it --version")
  end
end
