Closed iHiD closed 3 years ago
Yes. Exactly.
Rather than cmd
can we call this body
or test_body
or something since it may contain block of code within the test in addition to the assertion expression?
Also, it would avoid confusion between this and the previous cmd
key value, allowing later progressive enhancement of this feature seamlessly
I think expression
would fit well
Yes. Happy to rename.
test_code
maybe?
I don't love just body
(too generic) or expression
(doesn't imply to me that a complex multi-part piece of code would be allowed). I'd be ok with test_body
too. Whatever we choose, I think it should be multi-(programming)-lingual. I'm not sure if "body" is that? (I don't think expression is either as I've never used that term in Ruby)
test_body
would be ok
I'm in favor of test_body
or even test_code
.
edit: I just noticed that this PR actually uses "Test Code" in its UI example, so maybe that is the right suggestion?
If we're copying the test code into test_code
, then we shouldn't be manually populating that field per-test at all. Instead, we can populate a regular expression or something once per track, with a once-per-exercise optional override, which extracts per-test code.
Anything more manual than that adds maintenance burden, and is begging for things to get out of sync.
If we're copying the test code into test_code, then we shouldn't be manually populating that field per-test at all. Instead, we can populate a regular expression or something once per track, with a once-per-exercise optional override, which extracts per-test code.
Anything more manual than that adds maintenance burden, and is begging for things to get out of sync.
We're not expecting tracks to do this manually (which would be a very bad idea indeed), but instead expect the test runners to handle this complete automatically. Which is also what @neenjaw @TheLostLambda and I were already doing in our proof of concepts.
Anyone hate test_code
or can we go with that?
Going to merge this as it is. Will rename cmd
in a follow up shortly to give anyone time to object :)
It has become clear that having a separate
expected
key is causing too much pain for tracks. This PR changes the spec to remove it. I think this:Feedback welcome. Sorry this has been such a ridiculously painful journey.