Fix unrelated errors when teardowning quanrantined specs
Since we're skipping the example in a before hook, the @_subscribers instance variable that is normally set in the setup phase of the test by21014e48be/lib/rails/controller/testing/template_assertions.rb (L21)
isn't set but the teardown phase of the example still happens and tries to iterate over the array of subcribers:21014e48be/lib/rails/controller/testing/template_assertions.rb (L54)
Using an around hook allows the @_subscribers instance variable to be set. Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
b575b30343
commit
f59438c0a9
|
@ -138,7 +138,7 @@ RSpec.configure do |config|
|
||||||
.and_return(false)
|
.and_return(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
config.before(:example, :quarantine) do
|
config.around(:example, :quarantine) do
|
||||||
# Skip tests in quarantine unless we explicitly focus on them.
|
# Skip tests in quarantine unless we explicitly focus on them.
|
||||||
skip('In quarantine') unless config.inclusion_filter[:quarantine]
|
skip('In quarantine') unless config.inclusion_filter[:quarantine]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue