#bdd #cucumber #gherkin #rstest

rstest-bdd-patterns

Shared step-pattern compilation utilities for rstest-bdd

3 releases

0.1.0 Nov 8, 2025
0.1.0-alpha4 Sep 30, 2025
0.1.0-alpha3 Sep 27, 2025

#1264 in Testing

Download history 102/week @ 2025-09-23 224/week @ 2025-09-30 87/week @ 2025-10-07 336/week @ 2025-10-14 245/week @ 2025-10-21 157/week @ 2025-10-28 190/week @ 2025-11-04 90/week @ 2025-11-11 32/week @ 2025-11-18

497 downloads per month
Used in 4 crates (2 directly)

ISC license

36KB
829 lines

rstest-bdd-patterns

Shared step-pattern compilation utilities used by both the rstest-bdd runtime crate and the rstest-bdd-macros procedural macros. The crate exposes the placeholder parsing and regex generation engine so both dependants can validate and execute Behaviour-Driven Development steps without duplicating logic.

The API is intentionally small: it provides helpers for turning annotated step literals into regular expressions, along with supporting error types and placeholder parsing utilities. Downstream crates wrap these primitives in user-facing APIs tailored to their compile-time or runtime responsibilities.

Usage

use regex::Regex;
use rstest_bdd_patterns::{build_regex_from_pattern, extract_captured_values};

let regex_src = build_regex_from_pattern("I have {count:u32}")
    .expect("example ensures fallible call succeeds");
let regex = Regex::new(&regex_src)
    .expect("example ensures fallible call succeeds");
let captures = extract_captured_values(&regex, "I have 3")
    .expect("example ensures fallible call succeeds");
assert_eq!(captures, vec!["3".to_string()]);

Dependencies

~2.1–3.5MB
~65K SLoC