How to test a generator for a plugin

I’m adding a generator to a popular plugin, and the core team has
sensibly requested that I submit tests for the generator.
Unfortunately, there seems to be a lot of code tied to railties in the
rails generator tests. Is there a recommended way to handle this