New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tmp directory cleanup after running generator #5
Comments
Its intentional that it leaves the files there. I find it useful when something goes wrong to be able to look at the generated files to see what happened. Typically I add tmp to my .gitignore so it doesn't what gets committed. You could also add an |
I agree it's a nice feature if something goes wrong but it would be neat to just delete it if all tests pass successfully. It's not really a big deal, if you prefer to keep it in all cases, I will call the method in an after block. Can I know from rspec if the tests pass in the after block ? |
Hmm that's an interesting idea to conditionally leave the files there when there's a failure. But I'm not sure it would give you what you want unless the failure is the last spec to run. The way it currently works doesn't leave the "bad" files around either though. It looks like rspec does support what you'd like to do rspec/rspec-core#401. You can write
This will rm_rf then do a mkdir so you'll be left with a Is your suggestion that I add something like this into ammeter so you it becomes the default behavior? |
Yeah you are right, it would be only useful if you use |
When I run my specs on this gem, the tmp directory used to test the generator remains after spec finishes, and contains app, config and db folders, along with the files generated by the generator. I don't know if it comes from my specs code or if it's a bug.
The text was updated successfully, but these errors were encountered: