Revert "Enable RSpec/LeakyConstantDeclaration"

This commit is contained in:
Mike McQuaid 2023-01-26 09:47:20 +00:00 committed by GitHub
parent a1680aebe3
commit a7503ec713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 20 deletions

View File

@ -11,6 +11,8 @@ RSpec/SubjectStub:
# TODO: try to enable these # TODO: try to enable these
RSpec/DescribeClass: RSpec/DescribeClass:
Enabled: false Enabled: false
RSpec/LeakyConstantDeclaration:
Enabled: false
RSpec/MessageSpies: RSpec/MessageSpies:
Enabled: false Enabled: false
RSpec/StubbedMock: RSpec/StubbedMock:

View File

@ -89,12 +89,9 @@ describe "Exception" do
let(:mod) do let(:mod) do
Module.new do Module.new do
# These are defined within an anonymous module to avoid polluting the global namespace.
# rubocop:disable RSpec/LeakyConstantDeclaration
class Bar < Requirement; end class Bar < Requirement; end
class Baz < Formula; end class Baz < Formula; end
# rubocop:enable RSpec/LeakyConstantDeclaration
end end
end end

View File

@ -9,15 +9,16 @@ module Homebrew
include described_class include described_class
describe "#free_port" do describe "#free_port" do
it "returns a free TCP/IP port" do
# IANA suggests user port from 1024 to 49151 # IANA suggests user port from 1024 to 49151
# and dynamic port for 49152 to 65535 # and dynamic port for 49152 to 65535
# http://www.iana.org/assignments/port-numbers # http://www.iana.org/assignments/port-numbers
min_port = 1024 MIN_PORT = 1024
max_port = 65535 MAX_PORT = 65535
it "returns a free TCP/IP port" do
port = free_port port = free_port
expect(port).to be_between(min_port, max_port) expect(port).to be_between(MIN_PORT, MAX_PORT)
expect { TCPServer.new(port).close }.not_to raise_error expect { TCPServer.new(port).close }.not_to raise_error
end end
end end

View File

@ -4,17 +4,15 @@
require "formula" require "formula"
describe "patching" do describe "patching" do
before do TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
stub_const("TESTBALL_URL", "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz") TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz"
stub_const("TESTBALL_PATCHES_URL", "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz") PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff"
stub_const("PATCH_URL_A", "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff") PATCH_URL_B = "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff"
stub_const("PATCH_URL_B", "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff") PATCH_A_CONTENTS = File.read("#{TEST_FIXTURE_DIR}/patches/noop-a.diff").freeze
stub_const("PATCH_A_CONTENTS", File.read("#{TEST_FIXTURE_DIR}/patches/noop-a.diff").freeze) PATCH_B_CONTENTS = File.read("#{TEST_FIXTURE_DIR}/patches/noop-b.diff").freeze
stub_const("PATCH_B_CONTENTS", File.read("#{TEST_FIXTURE_DIR}/patches/noop-b.diff").freeze) APPLY_A = "noop-a.diff"
stub_const("APPLY_A", "noop-a.diff") APPLY_B = "noop-b.diff"
stub_const("APPLY_B", "noop-b.diff") APPLY_C = "noop-c.diff"
stub_const("APPLY_C", "noop-c.diff")
end
def formula(name = "formula_name", path: Formulary.core_path(name), spec: :stable, alias_path: nil, &block) def formula(name = "formula_name", path: Formulary.core_path(name), spec: :stable, alias_path: nil, &block)
Class.new(Formula) { Class.new(Formula) {