Cucumber 的 Ruby 版本。太棒了!
Cucumber 是一个用于运行以自然语言编写的自动化测试的工具。由于这些测试是用自然语言编写的,团队中的任何人都可以阅读它们。因为任何人都可以阅读,你可以利用它们来改善团队内部的沟通、协作与信任。
这是 Cucumber 的 Ruby 实现。Cucumber 也支持 JavaScript。
有关为 Cucumber 做贡献(issue、PR 等)的信息,请参阅 CONTRIBUTING.md。
在本代码库和 issue 跟踪器中互动的所有人都应遵守 Cucumber 的行为准则。
Cucumber for Ruby 是一个 Ruby gem。像安装任何 gem 一样安装它:将
cucumber 添加到你的 Gemfile 中:
gem 'cucumber'然后安装它:
$ bundle或者直接安装该 gem:
$ gem install cucumber在本文档的后续部分中,假定使用 bundler,因此所有命令都使用
bundle exec。如果你不是这种情况,请直接执行 cucumber,不带
bundle exec。
在使用 Ruby on Rails?你可以使用 cucumber-rails 将 Cucumber 引入你的 Rails 项目。
如有需要,可使用以下命令初始化你的 features 目录:
$ bundle exec cucumber --init这将在尚不存在的情况下创建以下目录和文件:
features
├── step_definitions
└── support
└── env.rb在 features 目录中创建一个名为 rule.feature 的文件,内容如下:
# features/rule.feature
Feature: Rule Sample
Rule: This is a rule
Example: A passing example
Given this will pass
When I do an action
[Java](https://github.com/cucumber/cucumber-jvm), and a lot of other languages. You can find a list of implementations here: https://cucumber.io/docs/installation/.暂无开放 Issues,或尚未同步最近议题。