Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TryCmd constructable by end-users #217

Open
indygreg opened this issue Jun 28, 2023 · 2 comments
Open

Make TryCmd constructable by end-users #217

indygreg opened this issue Jun 28, 2023 · 2 comments

Comments

@indygreg
Copy link

(Filing this issue in response to discussion on #214.)

As I made the case for in #214, there is value in leveraging trycmd's internal data structures (namely TryCmd and everything its fields reference) to build your own process based snapshot testing library or to bend trycmd to your will. If you could construct TryCmd instances manually (bypassing the file loaders that are forced onto us today), this would create opportunities for customers to experiment with different file formats and different ways of constructing test cases. It would enable customers to leverage the test running functionality in the trycmd crate without having to reinvent that wheel. i.e. I think it would increase the overall value of the trycmd crate.

The code changes for this are minimal (77e05d7). I suspect the real debate is what the crate API surface area should be. Obviously sprinkling pub everywhere has semver and API support implications.

@epage
Copy link
Contributor

epage commented Jun 28, 2023

Before getting into how to solve this, can we focus on the use cases? We offer snapbox as a lower level snapshotting library. What is it you are trying to accomplish that the current structure of trycmd and snapbox are getting in your way?

@indygreg
Copy link
Author

I don't want to have to build my own runner (with steps), diffing functionality, etc.

I agree that snapbox is a useful foundational crate to have. But there's just enough functionality missing that I wanted to reach for trycmd's abstractions instead of reinventing the wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants