brew vendor-gems: commit updates.

This commit is contained in:
BrewTestBot
2022-02-28 18:08:09 +00:00
parent 6b33f31c68
commit 42e4d9376e
120 changed files with 102 additions and 3 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.25.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.13.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.13.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.8.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.9.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.7/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib"
@@ -142,12 +142,24 @@ RSpec/Be:
StyleGuide: https://rspec.rubystyle.guide/#be-matcher
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be
RSpec/BeEq:
Description: Check for expectations where `be(...)` can replace `eq(...)`.
Enabled: pending
VersionAdded: 2.9.0
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEq
RSpec/BeEql:
Description: Check for expectations where `be(...)` can replace `eql(...)`.
Enabled: true
VersionAdded: '1.7'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEql
RSpec/BeNil:
Description: Check that `be_nil` is used instead of `be(nil)`.
Enabled: pending
VersionAdded: 2.9.0
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeNil
RSpec/BeforeAfterAll:
Description: Check that before/after(:all) isn't being used.
Enabled: true
@@ -0,0 +1,45 @@
# frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Check for expectations where `be(...)` can replace `eq(...)`.
#
# The `be` matcher compares by identity while the `eq` matcher compares
# using `==`. Booleans and nil can be compared by identity and therefore
# the `be` matcher is preferable as it is a more strict test.
#
# @example
#
# # bad
# expect(foo).to eq(true)
# expect(foo).to eq(false)
# expect(foo).to eq(nil)
#
# # good
# expect(foo).to be(true)
# expect(foo).to be(false)
# expect(foo).to be(nil)
#
class BeEq < Base
extend AutoCorrector
MSG = 'Prefer `be` over `eq`.'
RESTRICT_ON_SEND = %i[eq].freeze
# @!method eq_type_with_identity?(node)
def_node_matcher :eq_type_with_identity?, <<-PATTERN
(send nil? :eq {true false nil})
PATTERN
def on_send(node)
return unless eq_type_with_identity?(node)
add_offense(node.loc.selector) do |corrector|
corrector.replace(node.loc.selector, 'be')
end
end
end
end
end
end
@@ -43,7 +43,7 @@ module RuboCop
# @!method eql_type_with_identity(node)
def_node_matcher :eql_type_with_identity, <<-PATTERN
(send _ :to $(send nil? :eql {true false int float sym nil_type?}))
(send _ :to $(send nil? :eql {true false int float sym nil}))
PATTERN
def on_send(node)
@@ -0,0 +1,40 @@
# frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Check that `be_nil` is used instead of `be(nil)`.
#
# RSpec has a built-in `be_nil` matcher specifically for expecting `nil`.
# For consistent specs, we recommend using that instead of `be(nil)`.
#
# @example
#
# # bad
# expect(foo).to be(nil)
#
# # good
# expect(foo).to be_nil
#
class BeNil < Base
extend AutoCorrector
MSG = 'Prefer `be_nil` over `be(nil)`.'
RESTRICT_ON_SEND = %i[be].freeze
# @!method nil_value_expectation?(node)
def_node_matcher :nil_value_expectation?, <<-PATTERN
(send nil? :be nil)
PATTERN
def on_send(node)
return unless nil_value_expectation?(node)
add_offense(node) do |corrector|
corrector.replace(node.loc.expression, 'be_nil')
end
end
end
end
end
end

Some files were not shown because too many files have changed in this diff Show More