Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: load initializers.rb instead of require for working tests #700

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

jaredcwhite
Copy link
Member

Summary

This changes the code which executes Bridgetown's Ruby configuration DSL so initializer files in config are loaded via load rather than require

Context

In testing scenarios (such as plugin gems) when run_initializers! may be called many times across a series of tests, the available initializers were blank after the first run. That's because the file to set up those initializers wasn't getting executed by Ruby. We need to load rather than require those files.

I'm pretty sure this isn't a breaking change, but we'll want to keep an eye on any odd behavior (possibly due to some mistake in attempting to run initializers more than once on the same site config)

@render
Copy link

render bot commented Jan 24, 2023

@render
Copy link

render bot commented Jan 24, 2023

Copy link
Member

@ayushn21 ayushn21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 👏 ... all looks good to me ... tested on the bridgetown-sitemap plugin off this branch and it's green

@jaredcwhite jaredcwhite merged commit 4b7b90f into main Jan 24, 2023
@jaredcwhite jaredcwhite deleted the load-ruby-config-instead-of-require branch January 24, 2023 18:28
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.

2 participants