lib/rubocop/cop/rspec/multiple_describes.rb in rubocop-rspec-1.6.0 vs lib/rubocop/cop/rspec/multiple_describes.rb in rubocop-rspec-1.7.0

- old
+ new

@@ -1,28 +1,31 @@ # frozen_string_literal: true module RuboCop module Cop module RSpec - # Checks for multiple top level describes. They should be nested if it is - # for the same class or module or seperated into different files. + # Checks for multiple top level describes. # + # Multiple descriptions for the same class or module should either + # be nested or separated into different test files. + # # @example # # bad - # describe MyClass, '.do_someting' do + # describe MyClass, '.do_something' do # end - # describe MyClass, '.do_someting_else' do + # describe MyClass, '.do_something_else' do # end # # #good # describe MyClass - # describe '.do_someting' do + # describe '.do_something' do # end - # describe '.do_someting_else' do + # describe '.do_something_else' do # end # end class MultipleDescribes < Cop - include RuboCop::RSpec::TopLevelDescribe + include RuboCop::RSpec::SpecOnly, + RuboCop::RSpec::TopLevelDescribe MSG = 'Do not use multiple top level describes - ' \ 'try to nest them.'.freeze def on_top_level_describe(node, _args)