如何运行``rspec - init''用于子目录?''
我试图编写一个简单的红宝石代码来自动化任务。任务之一是初始化不是当前目录的目录的RSPEC GEM。
在Ruby文件中编写代码之前,我直接在终端中进行了第一次尝试。这是我尝试过的(在终端窗口中):
$rspec --init a_sub_directory
或
$rspec a_sub_directory --init
两种情况下的结果:所有RSPEC元素(.rspec + spec/spec_helper.rb)均在当前目录中创建,并且子目录没有更改其内容。
是否有可能在当前目录的子目录中创建RSPEC元素?
I'am trying to write a simple ruby code supposed to automate tasks. One of the task is initializing the rspec gem for a directory which is not the current directory.
I made first tries directly in the terminal before writing my code in he ruby file. Here is what I have tried (in a terminal window) :
$rspec --init a_sub_directory
OR
$rspec a_sub_directory --init
The result in both cases : all the rspec elements ( .rspec + spec/spec_helper.rb) are created in the current directory and the sub directory did not change its content.
Is there anything possible to get the rspec elements created in a sub directory of the current directory ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
dir.chdir
方法更改当前目录,然后执行rspec-init
。可能是:就是这样;我已经尝试过,它有效。
Use the
Dir.chdir
method to change the current directory and then executerspec --init
. It could be :And that's it; I've tried this, it works.