-
Notifications
You must be signed in to change notification settings - Fork 652
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 RSpec for AnnotateModels (1) #726
Refactor RSpec for AnnotateModels (1) #726
Conversation
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. Can clean up typos in future commit
(@model_file_name, @file_content) = write_model 'user.rb', <<-EOS | ||
class User < ActiveRecord::Base | ||
end | ||
(@model_file_name, @file_content) = write_model 'user.rb', <<~EOS |
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.
I looked up what the differences are in the doc string <<-
vs <<~
. Learning something new 👍
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.
cf. https://www.rubyguides.com/2018/11/ruby-heredoc/
I like <<~
because it makes code more clean.
When using VS Code, both strings indented with <<~
and that of <<-
can be collapsed, but the latter looks bad.
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.
Yep the <<~
does look more clean. I think that it may have not existed when that spec was written but now it does 😊
end | ||
end | ||
|
||
context 'without additional_file_patterns' do | ||
context 'when additional_file_patterns is not specified is the options' do |
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.
Some typos here, but we can clean that up in a later commit :)
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, I fixed it in #731.
end | ||
end | ||
|
||
context 'without additional_file_patterns' do | ||
context 'when additional_file_patterns is not specified is the options' do |
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.
Another typo here
I refactored and structuralized RSpec test cases of AnnotateModels for readability and scalability because it was too complex to read. cf. ctran#718 In this PR, I refactored test cases of some methods in `AnnotateModels`. I will refactor test cases of other methods in another PR.
I refactored and structuralized RSpec test cases of AnnotateModels for readability and scalability because it was too complex to read.
cf. #718
In this PR, I refactored test cases of some methods in
AnnotateModels
.I will refactor test cases of other methods in another PR.