Pattern: Inconsistent hook argument
Issue: -
Checks the arguments passed to before
, around
, and after
.
This rule checks for consistent style when specifying RSpec hooks which run for each example. There are three supported styles: "implicit", "each", and "example." All styles have the same behavior.
# bad
before(:each) do
# ...
end
# bad
before(:example) do
# ...
end
# good
before do
# ...
end
# bad
before(:example) do
# ...
end
# good
before do
# ...
end
# good
before(:each) do
# ...
end
# bad
before(:each) do
# ...
end
# bad
before do
# ...
end
# good
before(:example) do
# ...
end
Name | Default value | Configurable values |
---|---|---|
EnforcedStyle | implicit |
implicit , each , example |