feature: Generate a spec file.
Unlike schema migrations, data migrations are easy to test but require a bit of special setup. This adds a spec file to the generator.
- Loads the migration.
- Sets up the a quiet migrator object.
- Basic describe up/down blocks with subjects.
Closes #148
Good idea. However, what about the people who don't use rspec? Maybe there should be an env var or something that is set if you want to generate spec file? I there there is something in Rails itself about this, but don't remember exactly how it works there
Rails.configuration.generators.options[:rails] can be introspected to get the test_framework. I'll see about putting something together for minitest.
Cool. That's a great idea
On Dec 15, 2020 at 1:44 PM, <Michael G. Schwern (mailto:[email protected])> wrote:
Rails.configuration.generators.options[:rails] can be introspected to get the test_framework. I'll see about putting something together for minitest.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/ilyakatz/data-migrate/pull/162#issuecomment-745586543), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AACE7EVUHYLYUXPWXJWAT5TSU7KDLANCNFSM4U3XRL2A).
@schwern are you still interested in implementing this?
will give it a try someday Would be really useful to have that
@schwern are you still interested in implementing this?
Sure. I'll have to reload it into my brain.