lib/rubocop/cop/rspec/named_subject.rb in rubocop-rspec-1.38.1 vs lib/rubocop/cop/rspec/named_subject.rb in rubocop-rspec-1.39.0
- old
+ new
@@ -4,15 +4,15 @@
module Cop
module RSpec
# Checks for explicitly referenced test subjects.
#
# RSpec lets you declare an "implicit subject" using `subject { ... }`
- # which allows for tests like `it { should be_valid }`. If you need to
- # reference your test subject you should explicitly name it using
- # `subject(:your_subject_name) { ... }`. Your test subjects should be
- # the most important object in your tests so they deserve a descriptive
- # name.
+ # which allows for tests like `it { is_expected.to be_valid }`.
+ # If you need to reference your test subject you should explicitly
+ # name it using `subject(:your_subject_name) { ... }`. Your test subjects
+ # should be the most important object in your tests so they deserve
+ # a descriptive name.
#
# This cop can be configured in your configuration using the
# `IgnoreSharedExamples` which will not report offenses for implicit
# subjects in shared example groups.
#
@@ -37,10 +37,10 @@
#
# # also good
# RSpec.describe Foo do
# subject(:user) { described_class.new }
#
- # it { should be_valid }
+ # it { is_expected.to be_valid }
# end
class NamedSubject < Cop
MSG = 'Name your test subject if you need '\
'to reference it explicitly.'