Sha256: b38f4cb2d5a968288f944d67daac980cdda2d40b5bfb224c1a60cd95751e776f

Contents?: true

Size: 965 Bytes

Versions: 15

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      # Checks if there is an empty line after example group blocks.
      #
      # @example
      #   # bad
      #   RSpec.describe Foo do
      #     describe '#bar' do
      #     end
      #     describe '#baz' do
      #     end
      #   end
      #
      #   # good
      #   RSpec.describe Foo do
      #     describe '#bar' do
      #     end
      #
      #     describe '#baz' do
      #     end
      #   end
      #
      class EmptyLineAfterExampleGroup < Base
        extend AutoCorrector
        include EmptyLineSeparation

        MSG = 'Add an empty line after `%<example_group>s`.'

        def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
          return unless example_group?(node)

          missing_separating_line_offense(node) do |method|
            format(MSG, example_group: method)
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.13.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.19.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.18.1 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.18.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.17.1 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.17.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.16.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.15.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.14.2 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.14.1 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.14.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.13.2 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.13.1 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-2.13.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb