-
Notifications
You must be signed in to change notification settings - Fork 598
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
Refactor test cases of AnnotateRoutes as for Rake versions #754
Refactor test cases of AnnotateRoutes as for Rake versions #754
Conversation
CI for 2.4.x is failed due to recent update of seattlerb/sexp_processor. I made a PR of |
seattlerb/sexp_processor was fixed and CI have passed. Please review this PR. |
I fixed conflict of |
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.
Looks good, keep up the good work
expect(File).to receive(:open).with(ROUTE_FILE, 'wb').and_yield(mock_file) | ||
expect(File).to receive(:read).with(ROUTE_FILE).and_return(route_file_content) | ||
|
||
expect(AnnotateRoutes).to receive(:`).with('rake routes').and_return(rake_routes_result) |
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.
This is interesting 🤔. I had no idea that when you do
`rake routes`
It sends the message with method name `. Very neat.
expect(mock_file).to receive(:puts).with(expected_result) | ||
expect(AnnotateRoutes).to receive(:puts).with(MESSAGE_ANNOTATED) |
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.
Same with puts
, I didn't know that the object receiving the message is whatever object that it's being called in.
Refactor test cases for entire rewrite in the future.
Refactor test cases for entire rewrite in the future.