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

Add a helper for testing with various plugin configurations #79

Open
Julian opened this issue Feb 18, 2021 · 2 comments
Open

Add a helper for testing with various plugin configurations #79

Julian opened this issue Feb 18, 2021 · 2 comments

Comments

@Julian
Copy link

Julian commented Feb 18, 2021

It'd be nice to have a way with plenary's busted support to specify dependencies that test cases have on active plugins.

E.g., imagine a spec file for a function foo which does different things if the user has installed a dependency bar or another dependency baz -- then it'd be nice to have syntax or arguments or etc. which properly manage runtimepath and clearing enough state (or running in enough isolation) such that tests which want to run with bar loaded get that, and tests which want to run with baz loaded get that.

I don't 100% know what a solution to this looks like (though I suppose I'll know that in a few hours after implementing one in a bespoke way for my plugin), but it seems possibly like a thing that'd be more widely useful.

#54 may be related here in a distant way.

@matu3ba
Copy link
Contributor

matu3ba commented Oct 3, 2021

"spec file for a function" - a spec is just formalized code, which can be represented as code (ie a logic is also code).

As I understand it you want conditionally run integration tests for dependencies, but you are not specific what this interface should generalize over. Or what am I missing?

@Julian
Copy link
Author

Julian commented Oct 3, 2021

"spec file for a function" - a spec is just formalized code, which can be represented as code (ie a logic is also code).

That's a different definition of the word "spec". Here it means literally "the file format expected by busted", or plenary which provides a similar API.

As I understand it you want conditionally run integration tests for dependencies, but you are not specific what this interface should generalize over. Or what am I missing?

Sure, as I say when filing this I didn't design a solution, the point was first simply to say "this seems hard and that it shouldn't be".

But such an interface undoubtedly indeed would say which integration tests should run under which sub-vimrc (including runtimepath configuration), perhaps. Putting that within each spec file though is likely too late though, since the test runner likely would want to know that info before farming out the file. So, again brainstorming, a decent place to put that info may instead be in a top-level config file for the test runner, and would map test files to alternate configs.

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