File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ module RSpec
66 # Checks for explicitly referenced test subjects.
77 #
88 # RSpec lets you declare an "implicit subject" using `subject { ... }`
9- # which allows for tests like `it { should be_valid }`. If you need to
10- # reference your test subject you should explicitly name it using
11- # `subject(:your_subject_name) { ... }`. Your test subjects should be
12- # the most important object in your tests so they deserve a descriptive
13- # name.
9+ # which allows for tests like `it { is_expected.to be_valid }`.
10+ # If you need to reference your test subject you should explicitly
11+ # name it using `subject(:your_subject_name) { ... }`. Your test subjects
12+ # should be the most important object in your tests so they deserve
13+ # a descriptive name.
1414 #
1515 # This cop can be configured in your configuration using the
1616 # `IgnoreSharedExamples` which will not report offenses for implicit
@@ -39,7 +39,7 @@ module RSpec
3939 # RSpec.describe Foo do
4040 # subject(:user) { described_class.new }
4141 #
42- # it { should be_valid }
42+ # it { is_expected.to be_valid }
4343 # end
4444 class NamedSubject < Cop
4545 MSG = 'Name your test subject if you need ' \
Original file line number Diff line number Diff line change @@ -2120,11 +2120,11 @@ Enabled | No
21202120Checks for explicitly referenced test subjects.
21212121
21222122RSpec lets you declare an "implicit subject" using ` subject { ... } `
2123- which allows for tests like ` it { should be_valid } ` . If you need to
2124- reference your test subject you should explicitly name it using
2125- ` subject(:your_subject_name) { ... } ` . Your test subjects should be
2126- the most important object in your tests so they deserve a descriptive
2127- name.
2123+ which allows for tests like ` it { is_expected.to be_valid } ` .
2124+ If you need to reference your test subject you should explicitly
2125+ name it using ` subject(:your_subject_name) { ... } ` . Your test subjects
2126+ should be the most important object in your tests so they deserve
2127+ a descriptive name.
21282128
21292129This cop can be configured in your configuration using the
21302130` IgnoreSharedExamples ` which will not report offenses for implicit
@@ -2155,7 +2155,7 @@ end
21552155RSpec .describe Foo do
21562156 subject(:user ) { described_class.new }
21572157
2158- it { should be_valid }
2158+ it { is_expected.to be_valid }
21592159end
21602160```
21612161
You can’t perform that action at this time.
0 commit comments