Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuboCop: Style/CaseEquality #1124

Merged
merged 1 commit into from
Sep 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Library/Homebrew/compilers.rb
Expand Up @@ -49,7 +49,7 @@ def initialize(name, version, &block)
instance_eval(&block) if block_given?
end

def ===(compiler)
def fails_with?(compiler)
name == compiler.name && version >= compiler.version
end

Expand Down Expand Up @@ -127,7 +127,7 @@ def find_compiler
end

def fails_with?(compiler)
failures.any? { |failure| failure === compiler }
failures.any? { |failure| failure.fails_with?(compiler) }
end

def compiler_version(name)
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/test_compiler_failure.rb
Expand Up @@ -5,11 +5,11 @@ class CompilerFailureTests < Homebrew::TestCase
Compiler = Struct.new(:name, :version)

def assert_fails_with(compiler, failure)
assert_operator failure, :===, compiler
assert_operator failure, :fails_with?, compiler
end

def refute_fails_with(compiler, failure)
refute_operator failure, :===, compiler
refute_operator failure, :fails_with?, compiler
end

def compiler(name, version)
Expand Down