Skip to content

Commit ff6b291

Browse files
ngoralpirj
authored andcommitted
Replace should-example with expect-example
1 parent 03ce0a7 commit ff6b291

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/rubocop/cop/rspec/named_subject.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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 '\

manual/cops_rspec.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,11 +2120,11 @@ Enabled | No
21202120
Checks for explicitly referenced test subjects.
21212121

21222122
RSpec 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

21292129
This cop can be configured in your configuration using the
21302130
`IgnoreSharedExamples` which will not report offenses for implicit
@@ -2155,7 +2155,7 @@ end
21552155
RSpec.describe Foo do
21562156
subject(:user) { described_class.new }
21572157

2158-
it { should be_valid }
2158+
it { is_expected.to be_valid }
21592159
end
21602160
```
21612161

0 commit comments

Comments
 (0)