2021-01-31 14:50:29 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "rubocops/lines"
|
|
|
|
|
2024-02-18 15:11:11 -08:00
|
|
|
RSpec.describe RuboCop::Cop::FormulaAudit::MpiCheck do
|
2021-01-31 14:50:29 -05:00
|
|
|
subject(:cop) { described_class.new }
|
|
|
|
|
|
|
|
context "when auditing MPI dependencies" do
|
|
|
|
it "reports and corrects an offense when using depends_on \"mpich\" in homebrew/core" do
|
|
|
|
expect_offense(<<~RUBY, "/homebrew-core/")
|
|
|
|
class Foo < Formula
|
|
|
|
desc "foo"
|
|
|
|
url 'https://brew.sh/foo-1.0.tgz'
|
|
|
|
depends_on "mpich"
|
2025-05-30 16:42:32 -04:00
|
|
|
^^^^^^^^^^^^^^^^^^ FormulaAudit/MpiCheck: Formulae in homebrew/core should use `depends_on "open-mpi"` instead of `depends_on "mpich"`.
|
2021-01-31 14:50:29 -05:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
|
|
|
expect_correction(<<~RUBY)
|
|
|
|
class Foo < Formula
|
|
|
|
desc "foo"
|
|
|
|
url 'https://brew.sh/foo-1.0.tgz'
|
|
|
|
depends_on "open-mpi"
|
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|