Skip to content

Add regression test for circular require across load orders#67

Draft
lineoffligbot wants to merge 1 commit into
sparklemotion:masterfrom
hakanensari:test-load-order-regression
Draft

Add regression test for circular require across load orders#67
lineoffligbot wants to merge 1 commit into
sparklemotion:masterfrom
hakanensari:test-load-order-regression

Conversation

@lineoffligbot
Copy link
Copy Markdown

Adds a regression test that asserts no circular require warning is emitted for any load order of the gem's entry points.

Refs #66 (warning under require "http/cookie_jar"; require "http/cookie", which is what require "http" triggers via http/session preceding http/response). This test also covers the scenarios fixed in #65.

The test currently fails on scenario 4 (http/cookie_jar then http/cookie) on master, demonstrating #66. Opening as a draft — happy to adjust style/location, and I can follow up with a fix PR once you've confirmed a preferred direction in #66.

Implementation notes:

  • Subprocesses are required because circular-require warnings only fire on first load per process.
  • Bundler.with_unbundled_env scrubs bundle exec's env injections so the child process doesn't pre-activate the installed gem (which masks the warning).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant