lib/rubocop/cop/rspec/describe_class.rb in rubocop-rspec-1.6.0 vs lib/rubocop/cop/rspec/describe_class.rb in rubocop-rspec-1.7.0
- old
+ new
@@ -1,12 +1,11 @@
# frozen_string_literal: true
module RuboCop
module Cop
module RSpec
- # Check that the first argument to the top level describe is the tested
- # class or module.
+ # Check that the first argument to the top level describe is a constant.
#
# @example
# # bad
# describe 'Do something' do
# end
@@ -16,10 +15,10 @@
# end
#
# describe "A feature example", type: :feature do
# end
class DescribeClass < Cop
- include RuboCop::RSpec::TopLevelDescribe
+ include RuboCop::RSpec::SpecOnly, RuboCop::RSpec::TopLevelDescribe
MSG = 'The first argument to describe should be '\
'the class or module being tested.'.freeze
def_node_matcher :valid_describe?, <<-PATTERN