-
Notifications
You must be signed in to change notification settings - Fork 343
Integtest: Add tests for building all books #810
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
Conversation
Adds a basic test for building all books. I expect we'll want to refactor it significantly as we port more tests for Make to rspec, but this is a start!
Some text. | ||
ASCIIDOC | ||
src.init_repo 'source' | ||
src.write 'conf.yaml', <<~YAML |
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 think I'll end up having to make generating this file more parameterized and automatic but I'd like to wait for a follow up for that.
@@ -15,18 +15,6 @@ def sh(cmd) | |||
out | |||
end | |||
|
|||
## | |||
# Init a git repo in root and commit any files in it. | |||
def init_repo(root) |
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've moved this to the Source
object because we'll want to initialize many repos when testing --all
dest_file(file_name) | ||
end | ||
let(:contents) do | ||
return unless File.exist? file |
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.
It looks strange to me to have a return
in a let
block. Maybe you can just write the line in a if File.exist? file
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.
It does feel weird? I'm not really sure the if File.exist?
block is super clear either. I think for me coming from Java the return unless
is more clear but I can't speak to idiomatic ruby.
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 guess I think of let
blocks not quite as methods, more like procs. But this is not a critical thing and if you prefer using return
, that's no problem.
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!
Let me see if I can resolve the merge conflicts here.....
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.
@estolfo, could you have another look at this one when you get a chance? Merging master required I do a little reorganization!
Thanks for reviewing @estolfo! This is a big help! |
Adds a basic test for building all books. I expect we'll want to refactor
it significantly as we port more tests for Make to rspec, but this is a
start!