trycmd icon indicating copy to clipboard operation
trycmd copied to clipboard

Should `Action::Overwrite` in `Assert::subset_eq` overwrite files and dirs in expected root?

Open zummenix opened this issue 2 years ago • 2 comments

Maybe I'm missing something or using it wrong, please let me know. Current behaviour is that it just reports ok. Seems unexpected when one wants to prepare a snapshot.

zummenix avatar Aug 30 '23 11:08 zummenix

Yes, Overwrite should overwrite existing files when used with subset_eq.

Seems unexpected when one wants to prepare a snapshot.

Overwriting means replacing an existing item. It sounds like you are wanting to write out everything, whether there is an existing item or not. Is that correct?

epage avatar Aug 30 '23 21:08 epage

It sounds like you are wanting to write out everything, whether there is an existing item or not. Is that correct?

Yes, that's correct. To clarify, overwriting works for existing items but does not if a snapshot directory is empty. Thinking about it I can workaround this issue by first running a test to create snapshot files.

zummenix avatar Aug 31 '23 03:08 zummenix