Skip to content

Fix running a single spec file with rspec

Nick Thomas requested to merge (removed):fix-select2-helper into master

What does this MR do?

In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24694 we merged a fix for the select2 helper to avoid JS race conditions. However, in so doing, we broke invocations like:

bundle exec rspec spec/lib/gitlab/import_export/attribute_configuration_spec.rb

The result without this fix is:

An error occurred while loading ./spec/lib/gitlab/import_export/attribute_configuration_spec.rb.
Failure/Error: include WaitForRequests

NameError:
  uninitialized constant Select2Helper::WaitForRequests
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:74:in `block in load_missing_constant'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:74:in `rescue in load_missing_constant'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:56:in `load_missing_constant'
# ./spec/support/helpers/select2_helper.rb:14:in `<module:Select2Helper>'
# ./spec/support/helpers/select2_helper.rb:13:in `<main>'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
# /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
# ./spec/spec_helper.rb:42:in `block in <top (required)>'
# ./spec/spec_helper.rb:42:in `each'
# ./spec/spec_helper.rb:42:in `<top (required)>'
# ./spec/lib/gitlab/import_export/attribute_configuration_spec.rb:1:in `require'
# ./spec/lib/gitlab/import_export/attribute_configuration_spec.rb:1:in `<top (required)>'
# ------------------
# --- Caused by: ---
# NameError:
#   uninitialized constant Select2Helper::WaitForRequests
#   /home/lupine/.gem/ruby/2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
No examples found.


Finished in 0.00027 seconds (files took 6.05 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Does this MR meet the acceptance criteria?

Merge request reports