RuboCop: Style/CaseEquality

This commit is contained in:
Markus Reiter 2016-09-24 18:59:44 +02:00
parent 817bc2746e
commit b987230ddf
2 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ class CompilerFailure
instance_eval(&block) if block_given?
end
def ===(compiler)
def fails_with?(compiler)
name == compiler.name && version >= compiler.version
end
@ -127,7 +127,7 @@ class CompilerSelector
end
def fails_with?(compiler)
failures.any? { |failure| failure === compiler }
failures.any? { |failure| failure.fails_with?(compiler) }
end
def compiler_version(name)

View File

@ -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)