- Fix
RSpec/InstanceVariable
detection inside custom matchers. (@pirj) - Fix
RSpec/ScatteredSetup
to distinguish hooks with different metadata. (@pirj) - Add autocorrect support for
RSpec/ExpectActual
cop. (@dduugg, @pirj)
- Improve message and description of
FactoryBot/FactoryClassName
. (@ybiquitous) - Fix
FactoryBot/FactoryClassName
to ignoreHash
andOpenStruct
. (@jfragoulis)
- Implement
RSpec/DescribedClassModuleWrapping
to disallow RSpec statements within a module. (@kellysutton) - Fix documentation rake task to support Rubocop 0.75. (@nickcampbell18)
- Fix
RSpec/SubjectStub
to detect implicit subjects stubbed. (@QQism) - Fix
RSpec/Pending
not flaggingskip
with string values. (@pirj) - Add
AllowedExplicitMatchers
config option forRSpec/PredicateMatcher
. (@mkrawc) - Add
FactoryBot/FactoryClassName
cop. (@jfragoulis)
- Fix
RSpec/DescribedClass
's error whendescribed_class
is used as part of a constant. (@pirj) - Fix
RSpec/ExampleWording
autocorrect of multi-line docstrings. (@pirj) - Add
RSpec/ContextMethod
cop, to detect method names incontext
. (@geniou) - Update RuboCop dependency to 0.68.1 with support for children matching node pattern syntax. (@pirj)
- Add
RSpec/EmptyLineAfterExample
cop to check that there is an empty line after example blocks. (@pirj) - Fix
Capybara/CurrentPathExpectation
auto-corrector, to include optionignore_query: true
. (@onumis) - Fix
RSpec/Focus
detecting mixed array/hash metadata. (@dgollahon) - Fix
RSpec/Focus
to also detectpending
examples. (@dgollahon)
- Add
RSpec/ImplicitBlockExpectation
cop. (@pirj)
- Fix
RSpec/DescribedClass
's error when a local variable is part of the namespace. (@pirj)
- Remove
AggregateFailuresByDefault
config option ofRSpec/MultipleExpectations
. (@pirj) - Add
RSpec/LeakyConstantDeclaration
cop. (@jonatas, @pirj) - Improve
aggregate_failures
metadata detection ofRSpec/MultipleExpectations
. (@pirj) - Improve
RSpec/SubjectStub
detection and message. (@pirj) - Change message of
RSpec/LetSetup
cop to be more descriptive. (@foton) - Improve
RSpec/ExampleWording
to handle interpolated example messages. (@nc-holodakg) - Improve detection by allowing the use of
RSpec
as a top-level constant. (@pirj) - Fix
RSpec/DescribedClass
's incorrect detection. (@pirj) - Improve
RSpec/DescribedClass
's ability to detect inside modules and classes. (@pirj)
- Let
RSpec/DescribedClass
passStruct
instantiation closures. (@schmijos) - Fixed
RSpec/ContextWording
missingcontext
s with metadata. (@pirj) - Fix
FactoryBot/AttributeDefinedStatically
not working with an explicit receiver. (@composerinteralia) - Add
RSpec/Dialect
enforces custom RSpec dialects. (@gsamokovarov) - Fix redundant blank lines in
RSpec/MultipleSubjects
's autocorrect. (@pirj) - Drop support for ruby
2.2
. (@bquorning)
- Add
RSpec/Yield
cop, suggesting using theand_yield
method when stubbing a method, accepting a block. (@Darhazer) - Fix
FactoryBot/CreateList
autocorrect crashing when the factory is called with a block=. (@Darhazer) - Fixed
RSpec/Focus
not flagging some cases ofRSpec.describe
withfocus: true
. (@Darhazer) - Fixed
RSpec/Pending
not flagging some cases ofRSpec.describe
with:skip
. (@Darhazer) - Fix false positive in
RSpec/ReceiveCounts
when method nameexactly
,at_least
orat_most
is used along withtimes
, without being an RSpec API. (@Darhazer)
- Add
IgnoreSharedExamples
option forRSpec/NamedSubject
. (@RST-J) - Add autocorrect support for
Capybara/CurrentPathExpectation
cop. (@ypresto) - Add support for built-in
exists
matcher forRSpec/PredicateMatcher
cop. (@mkenyon) SingleArgumentMessageChain
no longer reports an array as it's only argument as an offense. (@Darhazer)
FactoryBot/CreateList
now ignorestimes
blocks with an argument. (@Darhazer)
- Add config to
RSpec/VerifiedDoubles
to enforcement of verification on unnamed doubles. (@BrentWheeldon) - Fix
FactoryBot/AttributeDefinedStatically
not working when there is a non-symbol key. (@vzvu3k6k) - Fix false positive in
RSpec/ImplicitSubject
whenis_expected
is used insideits()
block. (@Darhazer) - Add
single_statement_only
style toRSpec/ImplicitSubject
as a more relaxed alternative tosingle_line_only
. (@Darhazer) - Add
RSpec/UnspecifiedException
as a default cop to encourage more-specificexpect{}.to raise_error(ExceptionType)
, orraise_exception
style handling of exceptions. (@daveworth)
- Fix false negative in
FactoryBot/AttributeDefinedStatically
when attribute is defined onself
. (@Darhazer) RSpec/FactoryBot
cops will now also inspect thespec/factories.rb
path by default. (@bquorning)
RSpec/InstanceVariable
- Recommend local variables in addition tolet
. (@jaredbeck)- Add
RSpec/ImplicitSubject
cop. (@Darhazer) - Add
RSpec/HooksBeforeExamples
cop. (@Darhazer)
- Add
RSpec/ReceiveNever
cop enforcing usage ofnot_to receive
instead ofnever
matcher. (@Darhazer) - Fix false positive in
RSpec/EmptyLineAfterExampleGroup
cop when example is insideif
. (@Darhazer) - Add
RSpec/MissingExampleGroupArgument
to enforce first argument for an example group. (@geniou) - Drop support for ruby
2.1
. (@bquorning) - Add
FactoryBot/AttributeDefinedStatically
cop to help FactoryBot users with the deprecation of static attributes. (@composerinteralia, @seanpdoyle) - Remove
FactoryBot/DynamicAttributeDefinedStatically
andFactoryBot/StaticAttributeDefinedDynamically
cops. (@composerinteralia)
RSpec/LeadingSubject
now enforces subject to be before any examples, hooks or let declarations. (@Darhazer)- Fix
RSpec/NotToNot
to highlight only the selector (not_to
orto_not
), so it works also onexpect { ... }
blocks. (@bquorning) - Add
RSpec/EmptyLineAfterHook
cop. (@bquorning) - Add
RSpec/EmptyLineAfterExampleGroup
cop to check that there is an empty line after example group blocks. (@bquorning) - Fix
RSpec/DescribeClass
crashing onRSpec.describe
without arguments. (@Darhazer) - Bump RuboCop requirement to v0.56.0. (@bquorning)
- Fix
RSpec/OverwritingSetup
crashing if a variable is used as an argument forlet
. (@Darhazer)
- Fix false positive in
RSpec/EmptyExampleGroup
cop when methods named like a RSpec method are used. (@Darhazer) - Fix
Capybara/FeatureMethods
not working when there is require before the spec. (@Darhazer) - Fix
RSpec/EmptyLineAfterFinalLet
: allow a comment to be placed after latest let, requiring empty line after the comment. (@Darhazer) - Add
RSpec/ReceiveCounts
cop to enforce usage of :once and :twice matchers. (@Darhazer)
- Fix false positive in
RSpec/Pending
cop when pending is used as a method name. (@Darhazer) - Fix
FactoryBot/DynamicAttributeDefinedStatically
false positive when using symbol proc argument for a sequence. (@tdeo)
- Add
RSpec/SharedExamples
cop to enforce consistent usage of string to titleize shared examples. (@anthony-robin) - Add
RSpec/Be
cop to enforce passing argument to the genericbe
matcher. (@Darhazer) - Fix false positives in
StaticAttributeDefinedDynamically
andReturnFromStub
when a const is used in an array or hash. (@Darhazer) - Add
RSpec/Pending
cop to enforce no existing pending or skipped examples. This is disabled by default. (@patrickomatic) - Fix
RSpec/NestedGroups
cop support --auto-gen-config. (@walf443) - Fix false positives in
Capybara/FeatureMethods
when feature methods are used as property names in a factory. (@Darhazer) - Allow configuring enabled methods in
Capybara/FeatureMethods
. (@Darhazer) - Add
FactoryBot/CreateList
cop. (@Darhazer)
- Compatibility with RuboCop v0.53.0. (@bquorning)
- The
Rails/HttpStatus
cop is unavailable if therack
gem cannot be loaded. (@bquorning) - Fix
Rails/HttpStatus
not working with custom HTTP status codes. (@bquorning) - Fix
FactoryBot/StaticAttributeDefinedDynamically
to handle empty block. (@abrom) - Fix false positive in
FactoryBot/DynamicAttributeDefinedStatically
when a before/after callback has a symbol proc argument. (@abrom)
- Add
RSpec/Rails/HttpStatus
cop to enforce consistent usage of the status format (numeric or symbolic). (@anthony-robin, @jojos003) - Fix false negative in
RSpec/ReturnFromStub
when a constant is being returned by the stub. (@Darhazer) - Fix
FactoryBot/DynamicAttributeDefinedStatically
to handle dynamic attributes inside arrays/hashes. (@abrom) - Add
FactoryBot/StaticAttributeDefinedDynamically
(based on dynamic attribute cop). (@abrom)
- Fix error in
RSpec/DescribedClass
when working on an emptydescribe
block. (@bquorning)
- Fix false positives in
RSpec/ReturnFromStub
. (@Darhazer)
- Updates
describe_class
to account for RSpecs:system
wrapper of rails system tests. (@EliseFitz15) - Add
RSpec/ExpectChange
cop to enforce consistent usage of the change matcher. (@Darhazer) - Add autocorrect support to
RSpec/LetBeforeExamples
. (@Darhazer) - Fix
RSpec/InstanceVariable
flagging instance variables inside dynamically defined class. (@Darhazer) - Add autocorrect support for
RSpec/ReturnFromStub
cop. (@bquorning) - Add
RSpec/ExampleWithoutDescription
cop. (@Darhazer)
- Compatibility with RuboCop v0.52.0. (@bquorning)
- Improve performance when user does not override default RSpec Pattern config. (@walf443)
- Add
AggregateFailuresByDefault
configuration forRSpec/MultipleExpectations
cop. (@onk)
- Add "without" to list of default allowed prefixes for
RSpec/ContextWording
. (@bquorning)
- Rename namespace
FactoryGirl
toFactoryBot
following original library update. (@walf443) - Fix exception in
RSpec/ReturnFromStub
on empty block. (@yevhene) - Add
RSpec/ContextWording
cop. (@pirj, @telmofcosta) - Fix
RSpec/SubjectStub
cop matches receive message inside all matcher. (@walf443)
Compatibility release so users can upgrade RuboCop to 0.51.0. No new features.
- Fix false positive in
Capybara/FeatureMethods
. (@Darhazer) - Add
RSpec/Capybara/CurrentPathExpectation
cop for feature specs, disallowing setting expectations oncurrent_path
. (@timrogers) - Fix false positive in
RSpec/LetBeforeExamples
cop when example group contains single let. (@Darhazer)
- Improved
RSpec/ReturnFromStub
to handle string interpolation, hashes and do..end blocks. (@Darhazer) - Fixed compatibility with JRuby. (@zverok)
- Add
RSpec/Capybara
namespace including the first cop for feature specs:Capybara/FeatureMethods
. (@rspeicher) - Update to RuboCop 0.50.0. (@bquorning)
- Add
RSpec/FactoryGirl
namespace including the first cop for factories:FactoryGirl/DynamicAttributeDefinedStatically
. (@jonatas) - Add disabled by default
RSpec/AlignLeftLetBrace
. (@backus) - Add disabled by default
RSpec/AlignRightLetBrace
. (@backus) - Add
RSpec/LetBeforeExamples
cop. (@Darhazer) - Add
RSpec/MultipleSubjects
cop. (@backus) - Add
RSpec/ReturnFromStub
cop. (@Darhazer) - Add
RSpec/VoidExpect
cop. (@pocke) - Add
RSpec/InvalidPredicateMatcher
cop. (@pocke) - Change HookArgument cop to detect when hook has a receiver. (@pocke)
- Add
RSpec/PredicateMatcher
cop. (@pocke) - Add
RSpec/ExpectInHook
cop. (@pocke) RSpec/MultipleExpectations
now detects usage of expect_any_instance_of. (@Darhazer)RSpec/MultipleExpectations
now detects usage of is_expected. (@bmorrall)
- Fix the handling of various edge cases in the
RSpec/ExampleWording
cop, including one that would cause autocorrect to crash. (@dgollahon) - Fix
RSpec/IteratedExpectation
crashing when there is an assignment in the iteration. (@Darhazer) - Fix false positive in
RSpec/SingleArgumentMessageChain
cop when the single argument is a hash. (@Darhazer)
- Add
RSpec/DescribeSymbol
cop. (@rspeicher) - Fix error when
RSpec/OverwritingSetup
andRSpec/ScatteredLet
analyzed empty example groups. (@backus)
- Add
RSpec/OverwritingSetup
cop. (@Darhazer) - Add autocorrect support for
RSpec/LeadingSubject
cop. (@Darhazer) - Add
RSpec/ScatteredLet
cop. (@Darhazer) - Add
RSpec/IteratedExpectation
cop. (@Darhazer) - Add
RSpec/EmptyLineAfterSubject
cop. (@Darhazer) - Add
RSpec/EmptyLineAfterFinalLet
cop. (@Darhazer)
- Add repeated 'it' detection to
RSpec/ExampleWording
cop. (@dgollahon) - Add [observed_nesting/max_nesting] info to
RSpec/NestedGroups
messages. (@dgollahon) - Add
RSpec/ItBehavesLike
cop. (@dgollahon) - Add
RSpec/SharedContext
cop. (@Darhazer) RSpec/MultipleExpectations
: Count aggregate_failures block as single expectation. (@Darhazer)- Fix
ExpectActual
cop flaggingrspec-rails
routing specs. (@backus) - Fix
FilePath
cop not registering offenses for files likespec/blog/user.rb
when it should bespec/blog/user_spec.rb
. (@backus)
- Add
RSpec/InstanceSpy
cop. (@Darhazer) - Add
RSpec/BeforeAfterAll
for avoiding leaky global test setup. (@cfabianski)
- Add
AroundBlock
cop. (@Darhazer) - Add
EnforcedStyle
configuration forRSpec/DescribedClass
cop. (@Darhazer) - Fix false positive for
RSpec/RepeatedExample
cop. (@redross)
- Fix false negative for
RSpec/MessageSpies
cop. (@onk) - Fix internal dependencies on RuboCop to be compatible with 0.47 release. (@backus)
- Add autocorrect support for
SingleArgumentMessageChain
cop. (@bquorning) - Rename
NestedGroups
' configuration key fromMaxNesting
toMax
in order to be consistent with other cop configuration. (@backus) - Add
RepeatedExample
cop for detecting repeated examples within example groups. (@backus) - Add
ScatteredSetup
cop for enforcing that only onebefore
,around
, andafter
hook are used per example group scope. (@backus) - Add
ExpectOutput
cop for recommendingexpect { ... }.to output(...).to_stdout
. (@backus)
- Fix unintentional regression change in
NestedGroups
reported in #270. (@backus) - Change
MaxNesting
forNestedGroups
from 2 to 3. (@backus)
- Add
MessageSpies
cop for enforcing consistent style of eitherexpect(...).to have_received
orexpect(...).to receive
, intended as a replacement for theMessageExpectation
cop. (@bquorning) - Fix
DescribeClass
to not flagdescribe
at the top of a block of shared examples. (@clupprich) - Add
SingleArgumentMessageChain
cop for recommending use ofreceive
instead ofreceive_message_chain
where possible. (@bquorning) - Add
RepeatedDescription
cop for detecting repeated example descriptions within example groups. (@backus)
- Optionally ignore method names in the
describe
argument when running theFilePath
cop. (@bquorning) - Fix regression in how
FilePath
converts alphanumeric class names into paths. (@bquorning) - Add
ImplicitExpect
cop for enforcingshould
vs.is_expected.to
. (@backus) - Disable
MessageExpectation
cop in the default configuration. (@bquorning)
- Add support for checking all example groups with
ExampleLength
. (@backus) - Add support for checking shared example groups for
DescribedClass
. (@backus) - Add support for checking
its
from rspec-its. (@backus) - Add
EmptyExampleGroup
cop for detectingdescribe
s andcontext
s without any tests inside. (@backus) - Add
CustomIncludeMethods
configuration option forEmptyExampleGroup
. (@backus) - Add
NestedGroups
cop for detecting excessive example group nesting. (@backus) - Add
MaxNesting
configuration option forNestedGroups
cop. (@backus) - Add
ExpectActual
cop for detecting literal values withinexpect(...)
. (@backus) - Add
MultipleExpectations
cop for detecting multipleexpect(...)
calls within one example. (@backus) - Add
Max
configuration option forMultipleExpectations
. (@backus) - Add
SubjectStub
cop for testing stubbed test subjects. (@backus) - Add
LetSetup
cop for detecting cases wherelet!
is used for test setup. (@backus) - Change all cops to only inspect files with names following rspec convention (
*/spec/*
and/or_spec.rb
). (@backus) - Add
AllCops/RSpec
configuration option for specifying custom spec file patterns. (@backus) - Add
AssignmentOnly
configuration option forRSpec/InstanceVariable
cop. (@backus) - Add
BeEql
cop which looks for expectations that can usebe(...)
instead ofeql(...)
. (@backus) - Add autocorrect support for
BeEql
cop. (@backus) - Add
MessageExpectation
cop for enforcing consistent style of eitherexpect(...).to receive
orallow(...).to receive
. (@backus) - Add
MessageChain
cop. (@bquorning)
- Add
SkipBlocks
option forDescribedClass
cop. (@backus)
- Add
RSpec/NamedSubject
cop. (@backus)
- Drop support for ruby
2.0.0
and2.1.0
. (@backus) - Internal refactorings and improved test coverage. (@backus)
- Fix
unrecognized parameter RSpec/VerifiedDoubles:IgnoreSymbolicNames
warning. (@jeffreyc) - Update to rubocop 0.41.2. (@backus)
- Expand
VerifiedDoubles
cop to check forspy
as well asdouble
. (@andyw8) - Enable
VerifiedDoubles
cop by default. (@andyw8) - Add
IgnoreSymbolicNames
option forVerifiedDoubles
cop. (@andyw8) - Add
RSpec::ExampleLength
cop. (@andyw8) - Handle alphanumeric class names in
FilePath
cop. (@andyw8) - Skip
DescribeClass
cop for view specs. (@andyw8) - Skip
FilePath
cop for Rails routing specs. (@andyw8) - Add cop to check for focused specs. (@renanborgescampos, @jaredmoody)
- Clean-up
RSpec::NotToNot
to use same configuration semantics as other Rubocop cops, add autocorrect support forRSpec::NotToNot
. (@baberthal) - Update to rubocop 0.40.0. (@nijikon)
- Ignore routing specs for DescribeClass cop. (@nijikon)
- Move rubocop dependency to runtime. (@nijikon)
- Update to rubocop 0.39.0. (@nijikon)
- Update to rubocop 0.37.2. (@nijikon)
- Update ruby versions we test against. (@nijikon)
- Add
RSpec::NotToNot
cop. (@miguelfteixeira) - Add
RSpec/AnyInstance
cop. (@mlarraz)
- Fix auto correction issue - syntax had changed in RuboCop v0.31. (@bquorning)
- Add RuboCop clone to vendor folder - see #39 for details. (@bquorning)
- Ignore non string arguments for FilePathCop - thanks to @deivid-rodriguez. (@geniou)
- Skip DescribeMethod cop for tagged specs. (@deivid-rodriguez)
- Skip DescribeClass cop for feature/request specs. (@deivid-rodriguez)
- Make
RSpec::ExampleWording
case insensitive. (@geniou)
- Add
RSpec::VerifiedDoubles
cop. (@andyw8)
- Drop support of ruby
1.9.2
. (@geniou) - Update to RuboCop
~> 0.24
. (@geniou) - Add
autocorrect
toRSpec::ExampleWording
. This experimental - use with care and check the changes. (@geniou) - Fix config loader debug output. (@geniou)
- Rename
FileName
cop toFilePath
as a workaround - see #19. (@geniou)
- Add
autocorrect
toRSpec::DescribedClass
cop. (@geniou)
- Add
config
folder to gemspec. (@pstengel)
- Update to RuboCop
>= 0.23
. (@geniou) - Add configuration option for
CustomTransformation
toFileName
cop. (@geniou)
- Gem is no longer 20MB (sorry!). (@nevir)
RspecFileName
cop allows for method specs to organized into directories by class and type. (@nevir)
- Update code to work with rubocop
>= 0.19
. (@geniou) - Split
UnitSpecNaming
cop intoRSpecDescribeClass
,RSpecDescribeMethod
andRSpecFileName
and enabled them all by default. (@geniou) - Add
RSpecExampleWording
cop to prevent to use of should at the beginning of the spec description. (@geniou) - Fix
RSpecFileName
cop for non-class specs. (@geniou) - Adapt
RSpecFileName
cop to commen naming convention and skip spec with multiple top level describes. (@geniou) - Add
RSpecMultipleDescribes
cop to check for multiple top level describes. (@geniou) - Add
RSpecDescribedClass
to promote the use ofdescribed_class
. (@geniou) - Add
RSpecInstanceVariable
cop to check for the usage of instance variables. (@geniou)