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

Refactor test cases of AnnotateRoutes as for Rake versions #754

Merged

Conversation

nard-tech
Copy link
Collaborator

Refactor test cases for entire rewrite in the future.

@nard-tech
Copy link
Collaborator Author

nard-tech commented Feb 8, 2020

CI for 2.4.x is failed due to recent update of seattlerb/sexp_processor.

I made a PR of sexp_processor to fix this CI failure, so please wait for a while.
seattlerb/sexp_processor#29

@nard-tech
Copy link
Collaborator Author

nard-tech commented Feb 10, 2020

seattlerb/sexp_processor was fixed and CI have passed. Please review this PR.

@nard-tech nard-tech requested a review from drwl February 10, 2020 11:04
@nard-tech
Copy link
Collaborator Author

I fixed conflict of .rubocop_todo.yml

Copy link
Collaborator

@drwl drwl left a 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)
Copy link
Collaborator

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)
Copy link
Collaborator

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.

@drwl drwl merged commit d902dc4 into ctran:develop Feb 13, 2020
@nard-tech nard-tech deleted the feature/refactor_annotate_routes/rspec_v3 branch February 13, 2020 09:08
vfonic pushed a commit to vfonic/annotate_models that referenced this pull request May 8, 2020
Refactor test cases for entire rewrite in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants