aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/rubocops/caveats_cop_spec.rb
blob: 9c92d8fb8177f5c951b66c48c1103fd29d9b5a1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require_relative "../../rubocops/caveats_cop"

describe RuboCop::Cop::FormulaAudit::Caveats do
  subject(:cop) { described_class.new }

  context "When auditing caveats" do
    it "When there is setuid mentioned in caveats" do
      expect_offense(<<~RUBY)
        class Foo < Formula
          homepage "http://example.com/foo"
          url "http://example.com/foo-1.0.tgz"
           def caveats
            "setuid"
             ^^^^^^ Don\'t recommend setuid in the caveats, suggest sudo instead.
          end
        end
      RUBY
    end
  end
end