Skip to content

Commit

Permalink
Replace should-example with expect-example
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoral authored and pirj committed Apr 27, 2020
1 parent 03ce0a7 commit ff6b291
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/rubocop/cop/rspec/named_subject.rb
Expand Up @@ -6,11 +6,11 @@ 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
Expand Down Expand Up @@ -39,7 +39,7 @@ module RSpec
# 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 '\
Expand Down
12 changes: 6 additions & 6 deletions manual/cops_rspec.md
Expand Up @@ -2120,11 +2120,11 @@ Enabled | No
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
Expand Down Expand Up @@ -2155,7 +2155,7 @@ end
RSpec.describe Foo do
subject(:user) { described_class.new }

it { should be_valid }
it { is_expected.to be_valid }
end
```

Expand Down

0 comments on commit ff6b291

Please sign in to comment.