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

assert_file_contains: print regex on error #57

Merged

Conversation

zeeke
Copy link

@zeeke zeeke commented Mar 23, 2023

In case of assertion failure, seeing the missing regex in the test output is helpful.

This PR change the assert_file_contains /home/test/file1.txt regex1 output from:

   -- file does not contain regex --
   path : /home/test/file1.txt
   --

to

   -- file does not contain regex --
   path : /home/test/file1.txt
   regex : regex1
   --

@martin-schulze-vireso
Copy link
Member

I am a bit surprised that No Test failed. Please add a test that checks for the new output.

@zeeke zeeke force-pushed the improve_assert_file_contains branch from d83aee5 to 10a19bd Compare March 24, 2023 07:54
In case of assertion failure, seeing the missing regex
in the test output is helpful.

Add unit test on assertion output.

Signed-off-by: Andrea Panattoni <[email protected]>
@zeeke zeeke force-pushed the improve_assert_file_contains branch from 10a19bd to a5af548 Compare March 26, 2023 13:32
@martin-schulze-vireso martin-schulze-vireso merged commit 897c5c6 into bats-core:master Mar 26, 2023
@martin-schulze-vireso
Copy link
Member

Thanks for your contribution!

@martin-schulze-vireso
Copy link
Member

It seems we got an incomplete accidental addition of bats-support as submodule here. I reverted this change and should be more careful with reviews next time.

@zeeke
Copy link
Author

zeeke commented Mar 30, 2023

Sorry for that, I haven't noticed it when I pushed

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

Successfully merging this pull request may close these issues.

2 participants