Conversation
|
This may need to be updated after the exercism/problem-specifications#661 is brought in. |
68065c6 to
0214000
Compare
|
I've updated this per the newest canonical data. |
| "Take one down and pass it around, 98 bottles of beer on the wall.\n" | ||
| def test_first_generic_verse | ||
| # skip | ||
| expected = <<-TEXT |
There was a problem hiding this comment.
Using the <<-TEXT means that we can have the ending delimiter indented.
At the moment the ending delimiter is on the 1 column, so this is not needed. See comment regarding the generator for note.
| <%= test_case.skipped %> | ||
| expected = <<-TEXT | ||
| <%= test_case.expected %> | ||
| TEXT |
There was a problem hiding this comment.
Because of the <<-TEXT we could indent the ending delimiter to the level of line 11.
def <%= test_case.test_name %>
<%= test_case.skipped %>
expected = <<-TEXT
<%= test_case.expected %>
TEXT
assert_equal expected, <%= test_case.workload %>
end
<% end %>The other choice would be to remove the minus before the delimiter and leave the ending delimiter as it is.
There was a problem hiding this comment.
Oh, right. Yepp. I don't have strong feelings either way, but I think I'll indent the ending delimiter.
kotp
left a comment
There was a problem hiding this comment.
This looks good. We could bring it in now and there would be no foreseen problems.
One small change in the template file is possible, either removing the heredoc delimiter prefix or using that prefix and indenting the ending delimiter.
0214000 to
c0afeb9
Compare
|
I've updated the indentation of the closing token for the heredoc. I'm using the |
|
I'm just curious ... wouldn't it make more sense now that the canonical test data has a real version (beer-song/canonical-data.json#L3) to use that instead of the sha-1 hash of the commit ( |
|
I think the merge was done before the canonical was finished... but I think using that canonical version now makes sense to reference. |
|
Yeah, the canonical version makes much more sense. I didn't think of it. |
I've submitted a pull request to update the canonical data for the beer-song exercise (exercism/problem-specifications#661). In order to make it easier to pull in those changes once the PR has been merged, I've created a generator for the beer-song exercise.
In addition to implementing the logic for the generator, I ran the
bin/generate beer-songcommand to create a fresh implementation.The structure of the canonical data is a bit different from the implementation that the Ruby track had:
Before:
After:
In the old version,
lyricswas a simple indirection, callingverseswith the full range.This is a breaking change, and the book-keeping has been updated to reflect this.
As I implemented the generator, I discovered that the documentation was outdated. This has been updated in #552