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

test_require_individual_library_files: does not work correctly without bundler #780

Open
voxik opened this issue Feb 7, 2023 · 1 comment

Comments

@voxik
Copy link

voxik commented Feb 7, 2023

I am not sure is supposed be the purpose of the test_require_individual_library_files test case. I assume it should test that all files has correctly specified their requires. If that is the case, then this test works just when executed using bundle exec, but fails to catch, that the lib/sprockets/erb_processor.rb fails this condition. IOW this fails:

$ ruby -Ilib lib/sprockets/erb_processor.rb
lib/sprockets/erb_processor.rb:4:in `<main>': uninitialized constant Sprockets (NameError)

class Sprockets::ERBProcessor
      ^^^^^^^^^
Did you mean?  Process

while it works with bundle exec.

IMHO, the test case should ensure, that the files are required even without Bundler. It does not impact me in any real life example, so I'm just reporting.

@voxik
Copy link
Author

voxik commented Feb 7, 2023

BTW this workarounds the issue:

$ ruby -Ilib -rsprockets lib/sprockets/erb_processor.rb

And require 'sprockets' is what Bundler does by default, if I am not mistaken.

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

No branches or pull requests

1 participant