-
Notifications
You must be signed in to change notification settings - Fork 468
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
Fixes #629 #640
Fixes #629 #640
Conversation
Hmmm, that one failing build seems to be failing on other PRs as well - if I have time I'll take a look at it as well, but since it's happening on other PRs, and also it's a Rails 4.2 build and my changes are all behind a 5.0 check, I'm pretty confident it's unrelated to this change. |
@@ -22,7 +22,7 @@ class Apipie::Railtie | |||
prepend Apipie::Extractor::Recorder::FunctionalTestRecording | |||
end | |||
else | |||
ActionController::TestCase.send(:prepend, Apipie::Extractor::Recorder::FunctionalTestRecording) | |||
ActionController::TestCase::Behavior.send(:prepend, Apipie::Extractor::Recorder::FunctionalTestRecording) |
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.
The new version is not working for me. So I guess the original line was there for a reason, Why not to keep both lines in, so that it works for everyone?
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.
How sensible! :) Fix made and pushed.
The FunctionalTestRecording module's version of process() was not being called when running tests, which meant @collector was never initialized and so examples were not written to the file. To fix this, we need to prepend FunctionalTestRecording to ActionController::TestCase::Behavior, not ActionController::TestCase, for reasons which I honestly did not manage to determine.
Test failure unrelated. Thanks @Marri |
apipie-rails-0.5.14 has just been released, including this fix |
Thank you! |
The
FunctionalTestRecording
module's version ofprocess()
was not being called when running tests, which meant@collector
was never initialized and so examples were not written to the file.To fix this, we need to prepend
FunctionalTestRecording
toActionController::TestCase::Behavior
, notActionController::TestCase
, for reasons which I honestly did not manage to determine. (You can follow some of my debug rambling in the original issue.)I'm not actually clear if this fix is safe to merge as is; presumably the original version is there for a reason, I'd've expected the
prepend()
to apply to the subclass as well as the parent, and this may be more version-specific than I'm giving it credit for. My testing was all done against APIPie 0.5.13 and Rails 5.1.6 and Ruby 2.5.1 and RSpec 3.7.2. The full codebase is available at https://github.com/Marri/glowfic.