与西纳特拉一起泡菜?

发布于 2024-12-25 11:59:17 字数 148 浏览 1 评论 0原文

我对 ruby​​ web 开发非常陌生,并且一直在尝试 Sinatra。我喜欢我所看到的用于 BDD 风格测试的 Cucumber/Pickle。我已经配置并运行了 Cucumber,但现在很难集成 Pickle。它与西纳特拉兼容吗?我在网上看到的所有示例都主要针对 Rails。

I'm super new to ruby web development and have been experimenting with Sinatra. I like what I've seen of Cucumber/Pickle for BDD style testing. I've got Cucumber configured and working but am now stumped on integrating Pickle. Is it compatible with Sinatra? All the examples I've seen on the web are focused on Rails mainly.

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

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

发布评论

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

评论(1

强辩 2025-01-01 11:59:17

您可以获取pickle Rails生成器使用的模板并定制它们满足您的需求。

根据生成器的功能,您需要一个像这样的 features/support/pickle.rb 文件:

require 'pickle/world'
# Example of configuring pickle:
#
# Pickle.configure do |config|
#   config.adapters = [:machinist]
#   config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"'
# end
# require 'pickle/path/world'
# require 'pickle/email/world'

并且您需要将 pickle_steps.rb 拉入您的步骤目录。还有路径和路径的模板。有关电子邮件的具体步骤。

这有帮助吗?

You could grab the templates the pickle rails generator uses and tailor them to your needs.

From what the generator does, you'd need a features/support/pickle.rb file like this:

require 'pickle/world'
# Example of configuring pickle:
#
# Pickle.configure do |config|
#   config.adapters = [:machinist]
#   config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"'
# end
# require 'pickle/path/world'
# require 'pickle/email/world'

And you'd need to pull in the pickle_steps.rb into your steps directory. There's also templates for paths & for email specific steps.

Does that help?

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