Sinatra 测试框架

发布于 2024-10-03 13:03:44 字数 68 浏览 5 评论 0原文

测试 Sinatra Web 服务有哪些选项? RSpec 仍然理想吗?黄瓜?目前流行的 Sinatra 测试工具有哪些?

What are some options for testing Sinatra web services? Is RSpec still ideal? Cucumber? What are some of the current popular tools for testing Sinatra?

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

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

发布评论

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

评论(1

傲性难收 2024-10-10 13:03:44

这取决于您的项目的需求。通常我认为我会倾向于使用 RSpec 来测试 Web 服务,但我最近有一个项目,我们使用 Cucumber 代替。我认为 Cucumber 对我们来说是正确的选择,原因有几个。

首先,我们希望验收测试能够被广泛的团队角色所接受。实际上,我们能够让业务分析师编写我们的功能和场景的初稿,这确实为开发人员提供了良好的开端。

其次,我们需要测试的部分内容是用户难以处理的工件(电子邮件)。因此,对于我们正在测试的系统的端到端部分,经典的面向 UI 的 Cucumber 非常适合。

我已经用 Cucumber 在单元级别上尝试过驱动 TDD。我发现我更喜欢 Rspec:Cucumber 不像 Rspec 或其他单元级框架那么灵活。

所以我认为这有点取决于规模、范围和参与者。

It depends on the needs of your project. Ordinarily I think I would lean toward RSpec for testing web services, but I recently had a project where we used cucumber instead. I feel that Cucumber was the right choice for us for a couple of reasons.

First, we wanted acceptance tests which would be approachable by a wide range of team roles. We were actually able to get our business analysts to write the first draft of our features and scenarios, which really gave the developers a nice head start.

Secondly, part of what we needed to test were user-intractable artifacts (emails). So for that part of the end-to-end part of the system we were testing, classic UI-oriented cucumber was a great fit.

I've done some playing around with driving TDD at the unit level with Cucumber. I find that I prefer Rspec for that: Cucumber isn't as flexible as Rspec or other unit-level frameworks.

So I think it kinda depends on the scale, scope and the participants.

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