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

Better support for testing third-party compilers #1865

Closed
franklinhu opened this issue Apr 11, 2024 · 2 comments
Closed

Better support for testing third-party compilers #1865

franklinhu opened this issue Apr 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@franklinhu
Copy link

I understand that Tapioca compilers for third-party gems should live outside of the Tapioca repo (as per #1864), however it's difficult to write tests for those compilers since the test helpers available in this repo can't really be used outside or are not exported in the Tapioca gem.

For example, when trying to include Tapioca::Helpers::Test::DslCompiler in a third-party gem, this errors out due to private methods:

NoMethodError: private method `silence_warnings' called for module Tapioca
    /Users/franklin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/tapioca-0.13.1/lib/tapioca/helpers/test/content.rb:34:in `block in add_ruby_file'

It'd be nice if this was a better supported path. Thanks!

@KaanOzkan KaanOzkan added the bug Something isn't working label Apr 12, 2024
@KaanOzkan KaanOzkan self-assigned this Apr 24, 2024
@KaanOzkan
Copy link
Contributor

I can't reproduce using

require "tapioca/internal"
require "tapioca/helpers/test/dsl_compiler"

include Tapioca::Helpers::Test::DslCompiler

Did you have those requires?

@franklinhu
Copy link
Author

Cool looks like that fixes things up for me. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants