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
Clarify typhoeus callbacks tests #935
Clarify typhoeus callbacks tests #935
Conversation
nellirx
commented
Apr 24, 2022
- checking what is yielded in a clearer way
- documented suspicious behaviour with on_body callback when running single Request instance multiple times, i.e. request.run (commented with FIXME)
Looks like a warning that can be fixed - to pass the "no Warnings allowed" part of the suite. |
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.
Cool that you got it passing! Thanks for all the work!
I can see FIXME notes in the specs, are they "to be fixed in this commit" or are they for the future? If they are for the future, I'd like it very much if they had a run-on comment like "FIXME so that X doesn't Y when Z happens", to clarify what the FIXME refers to.
Thanks again for taking this on!
context 'after recording cassette (first request)' do | ||
before { on_body } | ||
|
||
it { expect(on_body).to have_attributes(body: 'Localhost responseLocalhost response') } # FIXME |
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.
Curious about these: is this change exposing the re-recording issue, or causing it? Should the FIXME be repaired in this PR?
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.
My intention was to expose what to me looks like an issue.
I'd prefer to address it separately please, if that's alright of course.
@olleolleolle thank you for the feedback! I have clarified what the FIXME refers to. |
@olleolleolle I decided to remove "FIXME" related tests to avoid confusion
Hope that's alright. Please let me know if any questions/suggestions. Thank you! |
Leaving assertions for body in on_headers callback test, because I don't yet know if body affected by on_headers callback or not.
Only streaming responses has no body, because those sent in chunks to the on_body callback.
Easier to see action which makes request and therefore requires cassette
Expecting replayed headers to match with originally recorded headers
Regardless of where response occurs, i.e. insdie or outside of callback.
Removes warning: `&' interpreted as argument prefix
Further investigation required to decide if we'd like to amend behavior or to capture it as it is.
68c386a
to
e30d729
Compare
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.
Thanks!
These are complicated tests, they are, but now they are cut up in their constituting parts.
Thanks for doing that!
@nellirx You did a lot of heavy lifting there - that's very helpful 🏆 ! |