Skip to content

Step with multi-line quoted #255

Answered by p-lewis
p-lewis asked this question in Q&A
Discussion options

You must be logged in to vote

I ended up finding it in the docstring of the Step. Something like this:

use cucumber::{gherkin::Step};

#[then(regex = r"lines (\d+)-(\d+) of (\w+) are")]
fn check_ppm_lines(world: &mut CanvasWorld, step: &Step, start: i32, stop: i32, ppm_name: String) {
    let docstr = step.docstring.as_ref().unwrap().as_str().trim();
}

Took me a minute to figure out that I needed gherkin::Step, not cucumber::Step.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by p-lewis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
1 participant