ruby icon indicating copy to clipboard operation
ruby copied to clipboard

Audit test files for assert/refute with no custom message

Open Cohen-Carlisle opened this issue 9 years ago • 11 comments

These should have a custom message put in place as without them you get a very unhelpful message like this:

Failed assertion, no message given.

Cohen-Carlisle avatar Jun 28 '16 02:06 Cohen-Carlisle

exercism/x-common#230 talks about this, Let's open an issue on x-common for any that need them.

And for the non-generated ones, l think we could make a check listed note here and do PR's against the list?

kotp avatar Jun 28 '16 06:06 kotp

Where they're generated, we can generate the custom message based on the inputs/outputs. The few times that we've had messages in the test data it's just been echoing the inputs, and it hasn't added any value.

kytrinyx avatar Jun 28 '16 18:06 kytrinyx

If we can do a good job of it, I say go for it. Writing good error messages can be hard, just about as hard as naming things, and they are more important, because if they are there, they are intended to hold your hand a little bit, and definitely should not misinform. I would rather have a non-informative error message than a misleading one.

kotp avatar Jun 29 '16 05:06 kotp

Currently these files still have this style of test:

  • [ ] exercises/allergies/allergies_test.rb
  • [ ] exercises/bracket-push/bracket_push_test.rb
  • [ ] exercises/clock/clock_test.rb
  • [ ] exercises/custom-set/custom_set_test.rb
  • [ ] exercises/grade-school/grade_school_test.rb
  • [ ] exercises/isogram/isogram_test.rb
  • [ ] exercises/leap/example.tt
  • [ ] exercises/leap/leap_test.rb
  • [ ] exercises/luhn/luhn_test.rb
  • [ ] exercises/pangram/pangram_test.rb
  • [ ] exercises/pythagorean-triplet/pythagorean_triplet_test.rb
  • [ ] exercises/queen-attack/queen_attack_test.rb
  • [ ] exercises/triangle/triangle_test.rb

kotp avatar Jan 04 '17 11:01 kotp

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 29 '17 20:04 stale[bot]

I'd rather see effort put into created canonical data and converting exercises to using generators than into crafting error messages for non-generated test suites.

hilary avatar Apr 30 '17 21:04 hilary

I wonder if @hilary comment will cause the Probot to now leave this open...

kotp avatar May 01 '17 09:05 kotp

I'd rather see effort put into created canonical data and converting exercises to using generators than into crafting error messages for non-generated test suites.

However, the generators should still be generating asserts with sensible failure messages, and we will need to check for this at some point.

Insti avatar May 01 '17 09:05 Insti

I would far rather see good error messages in the canonical data than generated messages for assert/refute, as I have yet to find generated assert/refute messages useful.

If they're doing red/green, they're looking at the tests anyway... but hey, if someone wants to put the effort into adding generated messages for assert/refute, I realize that meaningful error messages in the canonical data is ... unlikely.

hilary avatar May 02 '17 17:05 hilary

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 01 '17 18:07 stale[bot]

This is still relevant

Insti avatar Jul 20 '17 08:07 Insti

I think this can be closed now due to #1393 being merged.

kotp avatar Oct 05 '22 20:10 kotp

I wonder if that gave some Hacktoberfest credit for this year!

kotp avatar Oct 05 '22 20:10 kotp

I doubt it. Also I don't participate in hacktoberfest :)

kytrinyx avatar Oct 06 '22 07:10 kytrinyx

I think if anyone got points for it, it would have been Cohen.

kotp avatar Oct 06 '22 07:10 kotp

I think that would be a most excellent outcome!

kytrinyx avatar Oct 06 '22 08:10 kytrinyx