Skip to content

Prevent method redefinition warnings

gitlab-qa-bot requested to merge prevent_method_redefinition_warnings into master

Created by: JonRowe

Using subject twice, (or a let) in the same describe block will cause a warning, this currently affects rspec-rails quite a lot, this fix removes those warnings by removing the methods before redefining them.

The detection method limits the undef calls to only this scope, not nested scopes and also should be lazily efficient?

Merge request reports