无法将文件包括在规格文件中
我正在尝试为Ruby Project(Sketchup插件)编写RSPEC测试,但我正面临requient
的问题。
以下是我的文件夹的结构化
在我的smoke_tests_spec.rb
require "main_folder/subfolder1/file_to_test.rb"
我使用rspec-core/rspec
从根目录I运行RSPEC时获取以下错误
Failure/Error: require "main_folder/subfolder1/file_to_test.rb"
LoadError:
cannot load such file -- main_folder/subfolder1/file_to_test.rb
I am trying to write an RSpec test for a ruby project(Sketchup plugin) but I am facing an issue with the require
.
Below is how my folder is structured
In my smoke_tests_spec.rb
require "main_folder/subfolder1/file_to_test.rb"
When I run the rspec using rspec-core/rspec
from the root directory I get the following error
Failure/Error: require "main_folder/subfolder1/file_to_test.rb"
LoadError:
cannot load such file -- main_folder/subfolder1/file_to_test.rb
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要更改
load_path
或使用require_relative
在这里您有更多信息。
You need to change the
LOAD_PATH
or userequire_relative
Here you have more info.