Skip to content

acmcarther/cucumber

Repository files navigation

Cucumber (for Rust)

Note: This project is not actively maintained. Consider instead cucumber-rust, a Cucumber implementation with no external dependencies.

Build Status

Documentation

example run

Before Going Further

Please checkout the calculator example! That example is a full cargo project example showcasing Cucumber tests on real-ish behavior, and outputting a binary. It'll hopefully let you know if you like the testing style before really commiting to it.

Setup for your local Rust project

In your rust project:

Prerequisites

  • Install Ruby, preferably the same version as the one used here
  • Add a gemfile containing gem 'cucumber', similar to the example
    • Note: The examples don't have a Gemfile because they piggyback off of the gemfile in the main project

Project configuration

  • Add the cucumber dependency to your Cargo.toml
  • Add a feature directory, containing the following basic files
    • features/cuke.rs (based off the example)
    • features/step_definitions/cucumber_rust.wire (based off the example)
  • Add a cargo test entry to your Cargo.toml to hook cucumber tests into cargo test(based off example)

Usage

  • Run cargo test, and verify that cucumber executes with no steps
  • Add your *.feature files and step defintions as normal

Running the Cucumber tests for Cucumber

Just cargo test. Its configured (as in the examples) to be run with the rest of the tests.