Skip to content

Autoload RSpec::Mocks and RSpec::Expectations.

gitlab-qa-bot requested to merge autoload_other_rspec_libs into 2-14-maintenance

Created by: myronmarston

We already autoload RSpec::Matchers to support folks using RSpec::Matchers.define before the normal time that rspec-core loads rspec-expectation (e.g. right before eval'ing the first example group block). This extends it to RSpec::Mocks and RSpec::Expectations for parity and to improve things for folks who we accidentally broke via this rspec gem change:

https://github.com/rspec/rspec/commit/f10bedd498dff2961d4be9cce793fa152c4a0bbe

That was put in place to address rspec/rspec-mocks#359, which has more info.

Note: part of what's motivating this is that we've gotten some feedback that the rspec gem change referenced above inadvertently broke some users:

https://twitter.com/ericheikes/status/357522999567597569 https://github.com/rspec/rspec/commit/f10bedd498dff2961d4be9cce793fa152c4a0bbe#commitcomment-3609720

Merge request reports