Skip to content
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

Clean up at_exit into separate methods #153

Closed
colszowka opened this issue Jul 31, 2012 · 3 comments
Closed

Clean up at_exit into separate methods #153

colszowka opened this issue Jul 31, 2012 · 3 comments

Comments

@colszowka
Copy link
Collaborator

The at_exit handling in simplecov/defaults.rb is getting a bit out of hand, especially so with the stuff added thanks to #151. This should probably be moved to separate methods similar the custom SimpleCov.at_exit is already handled.

@pmontrasio
Copy link

I'm trying to build a statistical tool based on the coverage values stored in .last_run.json
I'm using the at_exit hook but unfortunately an inspection of simplecov/defaults.rb shows that the file is written after at_exit is run. This means that I'm not getting the latests results and the timestamp of the file (the latter is less important because I have Time.now).

Being an at_exit method I assumed it was run after everything else. How about an after_all method that runs really at the end, after the at_exit block?

By the way, do you have any suggestion about how to run my code when simplecov stops running? Thanks.

@pmontrasio
Copy link

I discovered that I can read the data I need from SimpleCov.result from within the at_exit block. This solves my problem and gives me access to much more data.
Nevertheless it would be nice to have a real at_exit hook running after everything else.

@PragTob
Copy link
Collaborator

PragTob commented Aug 16, 2020

Fixed 💃

@PragTob PragTob closed this as completed Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants