Rspec - 将输出格式设置为进度/文档/HTML [英] Rspec - Format output as Progress/Documentation/HTML

查看:42
本文介绍了Rspec - 将输出格式设置为进度/文档/HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Rspec,我希望能够同时看到标准进度条,输出到包含文档格式生成的规格表的文件,还有生成的 html 文件,无需多次运行测试.

Using Rspec, I want to be able to both see the standard progress bar, and output to a file containing the generated spec sheet in documentation format, and also have an html file generated, without running the tests multiple times.

如何为这些格式分配多种格式和文件目标?

How do I assign multiple formats and file targets for those formats?

推荐答案

我想出了如何做到这一点.您可以将以下内容添加到您的 .rspec 文件中(或者您想添加这些选项的任何地方,真的)

I figured out how to do this. You can add the following to your .rspec file (or wherever you want to throw in these options, really)

--format progress
--format documentation --color -o "documentation/file"
--format html -o "web/file"

您可以添加多种格式,它会完成所有格式.然后,您可以使用-o"命令设置这些格式的目标(因此它们不只是在您的标准输出中交错),后跟要创建的文件的名称.

You can add multiple formats, and it will do ALL of them. You can then set the target of those formats (so they aren't just interlaced in your standard output) with the "-o" command, followed by the name of the file to create.

这篇关于Rspec - 将输出格式设置为进度/文档/HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆