I’m writing to suggest a feature (which I’d easily be able to contribute). Currently, the assert_file method (in Rails::Generators::Testing::Assertions) has a failure message indicating that the file was not found. However, this method doesn’t give any insight into whether the file was not created or was just named the wrong thing. This is a particular problem in the case of generators that use dynamically generated filenames.
Here’s my use case: I’m working on testing a custom generator. My generator generates migrations for a second database. Like regular Rails migrations, this generator creates dynamic filenames that begin with a timestamp. When I’m testing the generator, it’d be useful to know whether the file has not been created or the timestamp just differs from that specified in the assertion.
It looks like this would be a trivial one-line change. Is this a PR that would be accepted?