Clarifying when and when not to declare gems in an engine's Gemfile

I am building an engine, and have wanted to use vcr in my tests. The current wording of the comments in the engine Gemfile template suggests that gems should only be declared there on a temporary basis, that is until they can be moved into the gemspec. However, adding a development dependency for vcr in the gemspec leads to vcr being added to the development environment. I then have to specifically disable vcr in my development environment.

After some experimentation, I have found that a better solution is to declare vcr within a test group in the engine’s Gemfile. I have attempted to find a definitive reason why declaring a gem used for testing, in the Gemfile would be a bad thing to do, but all I seem to find are generalised comments that gem declaration should be in the gemspec.

Therefore, I think the wording of the engine Gemfile template should be update so that it is less ambiguous about when you should or should not declare gems in an engine’s Gemfile. I have submitted a pull request comprising a suggested rewording of these comments:

https://github.com/rails/rails/pull/11881

Any thoughts?

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.