如何将 Cucumber 融入代码测试比?

发布于 2024-08-03 20:49:27 字数 121 浏览 1 评论 0原文

当我使用“rake stats”时,我可以知道我为 RSpec 测试编写了多少行代码。我的 RSpec 测试也会影响代码测试比。

但是我也可以在那里列出 Cucumber 步骤中的代码行吗?

此致

When I use "rake stats" I can get to know how many lines of code I have written for my RSpec tests. And my RSpec tests influences also the Code to Test Ratio.

But can I list my lines of code from the Cucumber steps there, too?

Best regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

無處可尋 2024-08-10 20:49:27

一个黄瓜步骤可以完成大量工作,我认为将其添加到代码/测试比率中实际上没有意义。它给你什么信息?如果您正在执行多个相关步骤怎么办?

Cucumber 测试是集成测试,它们不能替代控制器/单元测试,而是与它们一起完成。

您可能对黄瓜测试获得的结果代码覆盖率更感兴趣,这将是一个更有用的指标。

One cucumber step can do an awful lot of work, I don't think adding it to your code/test ratio would actually make sense. What information is it giving you? What if you are executing multiple dependent steps?

Cucumber tests are integration tests, they are not a replacement for controller/unit tests, but are to be done in conjunction with them.

You might be more interested in the resulting code coverage obtained by your cucumber tests, this will be a far more useful metric.

铃予 2024-08-10 20:49:27

请参阅这篇文章。只需在 rspec.rake 文件中添加两行代码即可。

See this post. It's as simple as adding two lines of code to rspec.rake file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文