在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cucumber/cucumber-ruby开源软件地址(OpenSource Url):https://github.com/cucumber/cucumber-ruby开源编程语言(OpenSource Language):Ruby 72.4%开源软件介绍(OpenSource Introduction):CucumberCucumber is a tool for running automated tests written in plain language. Because they're written in plain language, they can be read by anyone on your team. Because they can be read by anyone, you can use them to help improve communication, collaboration and trust on your team. This is the Ruby implementation of Cucumber. Cucumber is also available for JavaScript, Java, and a lot of other languages. You can find a list of implementations here: https://cucumber.io/docs/installation/. See CONTRIBUTING.md for info on contributing to Cucumber (issues, PRs, etc.). Everyone interacting in this codebase and issue tracker is expected to follow the Cucumber code of conduct. InstallationCucumber for Ruby is a Ruby gem. Install it as you would install any gem: add
then install it:
or install the gem directly:
Later in this document, bundler is considered being used so all commands are using
Supported platforms
Ruby on RailsUsing Ruby on Rails? You can use cucumber-rails to bring Cucumber into your Rails project. UsageInitializationIf you need to, initialize your
This will create the following directories and files if they do not exist already:
Create your specificationCreate a file named # features/rule.feature
Feature: Rule Sample
Rule: This is a rule
Example: A passing example
Given this will pass
When I do an action
Then some results should be there
Example: A failing example
Given this will fail
When I do an action
Then some results should be there
Automate your specificationAnd a file named # features/step_definitions/steps.rb
Given("this will pass") do
@this_will_pass = true
end
Given("this will fail") do
@this_will_pass = false
end
When("I do an action") do
end
Then("some results should be there") do
expect(@this_will_pass)
end Run Cucumber
To execute a single feature file:
To execute a single example, indicates the line of the name of the example:
To summarize the results on the standard output, and writte a HTML report on disk:
For more command line options
You can also find documentation on the command line possibilities in features/docs/cli. Documentation and support
CopyrightCopyright (c) Cucumber Ltd. and Contributors. See LICENSE for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论