diff options
author | Rémy Coutable <remy@rymai.me> | 2019-05-10 14:30:14 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-05-10 14:40:04 +0200 |
commit | f59438c0a9da7bb4d98291d2adedfc5a13a50798 (patch) | |
tree | cc08eb4e3d5298c76b20696dfdf7ddfc0ca2ac10 | |
parent | b575b303434577ab7d409a8c7321c0bce96d0994 (diff) | |
download | gitlab-ce-avoid-unrelated-errors-in-quarantined-specs.tar.gz |
Fix unrelated errors when teardowning quanrantined specsavoid-unrelated-errors-in-quarantined-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 by
https://github.com/rails/rails-controller-testing/blob/21014e48be124dd8d0af250b79f682519d445015/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: https://github.com/rails/rails-controller-testing/blob/21014e48be124dd8d0af250b79f682519d445015/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>
-rw-r--r-- | spec/spec_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9266bee34d6..69589c9aa33 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -138,7 +138,7 @@ RSpec.configure do |config| .and_return(false) end - config.before(:example, :quarantine) do + config.around(:example, :quarantine) do # Skip tests in quarantine unless we explicitly focus on them. skip('In quarantine') unless config.inclusion_filter[:quarantine] end |