-
Notifications
You must be signed in to change notification settings - Fork 95
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
Track time in before and after :context #107
Conversation
@ArturT Could you review please? |
expect(tracker).to receive(:start_timer) | ||
|
||
expect(tracker).to receive(:stop_timer) | ||
expect(tracker).to receive(:start_timer).ordered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement with ordered
. I did not know about it
https://relishapp.com/rspec/rspec-mocks/docs/setting-constraints/message-order
@caalberts Thank you for the PR. I've released a new version of knapsack 1.21.0. |
Note
There is no info about Just info for myself that this change might not work for legacy RSpec 2.x. But that's fine. RSpec 2.x was released last time in 2014 (long time ago). |
This PR introduced a new bug #108 I'm working on solving that. |
It's fixed and knapsack 1.21.1 has been released. |
This PR changes the start and end of the timer to be done in
prepend_before(:context)
andappend_after(:context)
so that the time tracked by Knapsack includes time spent inbefore(:context)
andafter(:context)
.Closes #106
Given a spec file as follows:
Finished in 5.72 seconds (files took 0.74649 seconds to load) 2 examples, 0 failures
The test takes a total of 5.7 seconds (5 + 2*0.1 + 0.2 + 0.3), as recorded by RSpec. Knapsack should also track this file as 5.7 seconds.