-
Hi! I am working on a port of cucumber/aruba to For anyone not familiar: Aruba, written in Ruby, is a supported part of Cucumber which provides a super useful set of Step Definitions and tools for testing command-line applications. I'd like to have these step definitions available when working on command-line applications in Rust in a way that is well-integrated and designed. Why? I've observed:
Wouldn't it be awesome if However, to get there, I have some questions! 😄 (1) How can a The challenge: As I understand it (please correct if I've misunderstood!), the design of Q: How should a library such as Assumption: I'll need to use the Feature: Help text
Scenario: If we pass the `--help` flag, we see usage documentation
When I run `aruba_hello_world --help`
Then the exit status should be 0
And the stdout contains: "Usage: " trait ArubaWorld {
fn last_command_run(&self) -> &Option<std::process::Command>
} (2) How can Thanks for any ideas! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Very interesting use-case, thanks for bringing that up. I've created a separate repository as an example: https://github.com/ilslv/cucumber-steps-as-library
You should create a library, that depends on The main limitation is that |
Beta Was this translation helpful? Give feedback.
-
Hi! I have found that this doesn't work if the opt-level is > 0. I've opened an issue about that: #347 |
Beta Was this translation helpful? Give feedback.
Very interesting use-case, thanks for bringing that up. I've created a separate repository as an example: https://github.com/ilslv/cucumber-steps-as-library
You should create a library, that depends on
cucumber
and exportsWorld
implementor with some step definitions. In example repo this is the/steps
directory. In case you need additional steps, downstream crates can add them to an existingWorld
implementor from another crate (/tests/cucumber.rs
has an example).The main limitation is that
World
implementor can't have generics, so I would advice adding something likeanymap
to it, so users could dy…