如何找到文件调用的路径需要?
我有一个大型test_helper
文件,其中包括用于单元的代码和集成测试。我想将其分成两部分,而不必更改每个需要“ test_helper”
。
为此,我想根据测试文件的文件路径调用 nime> unit_test_helper unit_test_helper 基于test文件的文件路径调用需要“ test_helper”
。
如何找到呼叫的文件路径需要“ test_helper”
?
I have a large test_helper
file which includes code for unit and integration test. I would like to split it into two, without having to change every require "test_helper"
.
To accomplish that, I want to conditionally call unit_test_helper
or integration_test_helper
based on the file path of the test file calling require "test_helper"
.
How can I find the path of the file calling require "test_helper"
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论