cucumber icon indicating copy to clipboard operation
cucumber copied to clipboard

Step registration syntax is ugly

Open acmcarther opened this issue 9 years ago • 3 comments

From https://github.com/acmcarther/cucumber/blob/master/features/cuke.rs#L20:

  cucumber::start(
    CucumberWorld::new(),
    &[
      &project_steps::register_steps,
    ]
  );

To a newcomer to rust (well, to anyone with eyeballs really), this looks obtuse for two reasons:

  1. &[] syntax is obnoxious
  2. Passing in registration functions is weird.

Maybe just update the examples to demo registering the steps manually, and add a macro to register them more terse-ly?

acmcarther avatar Jun 22 '16 20:06 acmcarther

How about a fluent interface for 1.? Something like this?

pJunger avatar Aug 26 '16 09:08 pJunger

Ah that looks awesome! Much more consistent behavior. Can you put up a pull request with that content?

A lot of random test might break. I can help in fixing them if you'd like.

acmcarther avatar Aug 26 '16 15:08 acmcarther

I can start a pr, but I cannot promise anything further for the next to weeks.

pJunger avatar Aug 26 '16 16:08 pJunger