lib/rubocop/cop/rspec/example_length.rb in rubocop-rspec-1.6.0 vs lib/rubocop/cop/rspec/example_length.rb in rubocop-rspec-1.7.0
- old
+ new
@@ -1,10 +1,12 @@
# frozen_string_literal: true
module RuboCop
module Cop
module RSpec
+ # Checks for long examples.
+ #
# A long example is usually more difficult to understand. Consider
# extracting out some behaviour, e.g. with a `let` block, or a helper
# method.
#
# @example
@@ -22,11 +24,12 @@
# service = described_class.new
# result = service.call
# expect(result).to be(true)
# end
class ExampleLength < Cop
- include CodeLength
- EXAMPLE_BLOCKS = [:it, :specify].freeze
+ include RuboCop::RSpec::SpecOnly, CodeLength
+
+ EXAMPLE_BLOCKS = RuboCop::RSpec::Language::Examples::ALL
def on_block(node)
method, _args, _body = *node
_receiver, method_name, _object = *method
return unless EXAMPLE_BLOCKS.include?(method_name)