mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

- Change name of rubocop warning - Disable linting on remaining offending lines - Add todos to move lines with disabled linting checks to extend/os in the future
23 lines
530 B
Ruby
23 lines
530 B
Ruby
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
require "rubocops/platform"
|
|
|
|
describe RuboCop::Cop::Homebrew::MoveToExtendOS do
|
|
subject(:cop) { described_class.new }
|
|
|
|
it "registers an offense when using `OS.linux?`" do
|
|
expect_offense(<<~RUBY)
|
|
OS.linux?
|
|
^^^^^^^^^ Move `OS.linux?` and `OS.mac?` calls to `extend/os`.
|
|
RUBY
|
|
end
|
|
|
|
it "registers an offense when using `OS.mac?`" do
|
|
expect_offense(<<~RUBY)
|
|
OS.mac?
|
|
^^^^^^^ Move `OS.linux?` and `OS.mac?` calls to `extend/os`.
|
|
RUBY
|
|
end
|
|
end
|