Sha256: 25cbb13ec254b30052a96e9c021644204632712f27b8a96da53fe071b824d0ab

Contents?: true

Size: 931 Bytes

Versions: 6

Compression:

Stored size: 931 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 RuboCop::RSpec::EmptyLineSeparation

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

        def on_block(node)
          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

6 entries across 6 versions & 1 rubygems

Version Path
rubocop-rspec-2.0.0.pre lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-1.44.1 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-1.44.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-1.43.2 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-1.43.1 lib/rubocop/cop/rspec/empty_line_after_example_group.rb
rubocop-rspec-1.43.0 lib/rubocop/cop/rspec/empty_line_after_example_group.rb