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

Allow asserting on files from the root of the project #291

Open
sleberrigaud opened this issue Oct 3, 2022 · 0 comments
Open

Allow asserting on files from the root of the project #291

sleberrigaud opened this issue Oct 3, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@sleberrigaud
Copy link

I can't (simply) write assertions on files from the root (basedir) of the project. I have a maven plugin that generates files outside of the target directory. Those generated files are meant to be committed alongside the code in the (git) repository.

I should be able to write an assertion like the following:

assertThat(result).isSuccessful()
                .project()
                .withFile("some-file-from-basedir");

Note that withFile right now, assumes one is looking up files in ${basedir}/target. So changing this would a breaking change.

Right now, I'm working around this by doing something like below:

assertThat(result).isSuccessful()
                .project()
                .withFile("../some-file-from-basedir"); // note the `..`

But even for this, I have to create an empty target directory, as my plugin/test does not do so.

Last note. I've discovered the project today and really like how it makes testing maven plugin finally easy and simple.

@sleberrigaud sleberrigaud added the enhancement New feature or request label Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant