Skip to content

Add missing requires in context.rb

Matthias Käppler requested to merge mk-add-missing-dependencies into master

While debugging a Ruby 3 related problem I noticed that I wasn't able to run just spec/labkit/context_spec.rb, because context.rb uses Ruby and Rails library functions that it does not require. It assumed that they were already loaded by the time this code is called by the application, but that is not the case when executing it outside of the app e.g. via a spec.

We should always make sure that classes/files are self-contained and specs can be executed in isolation. This MR adds the missing requires.

Edited by Matthias Käppler

Merge request reports