You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our codebase we've built some proc macro machinery, which allows us to reduce boilerplate using this library. An example could've looked something like this:
use std::convert::Infallible;use async_trait::async_trait;use cucumber::gherkin::Step;use cucumber_codegen::given;#[derive(cucumber_codegen::World)]pubstructWorld{pubfoo:i32,}#[async_trait(?Send)]impl cucumber::WorldforWorld{typeError = Infallible;asyncfnnew() -> Result<Self,Self::Error>{Ok(Self{foo:0})}}#[given(regex = r"(\S+) is (\d+)")]asyncfntest_regex_async(w:&mutWorld,step:String,#[given(step)]s:&Step,num:usize,){
tokio::time::delay_for(std::time::Duration::new(1,0)).await;assert_eq!(step, "foo");assert_eq!(num, 0);assert_eq!(s.value, "foo is 0");
w.foo += 1;}#[tokio::main]asyncfnmain(){use cucumber_codegen::WorldInitas _;let runner = World::init(&["./features"]);
runner.run().await;}
Under-the-hood it uses code generation via proc macros, some additional glue type definitions, and inventory for automatic step assertions registration.
We want to make public that machinery.
Are you interested with adding all of that to this crate? Or should we go with a diffent one?
The text was updated successfully, but these errors were encountered:
In our codebase we've built some proc macro machinery, which allows us to reduce boilerplate using this library. An example could've looked something like this:
Under-the-hood it uses code generation via proc macros, some additional glue type definitions, and
inventory
for automatic step assertions registration.We want to make public that machinery.
Are you interested with adding all of that to this crate? Or should we go with a diffent one?
The text was updated successfully, but these errors were encountered: