"Comparing SUnit with RSpec" â New blog post on all: objects all: theTime
Dear Pharo users and developers, After my previous blog post on SUnit, I added a follow-up post <https://all-objects-all-the-time.st/#/blog/posts/11> on the comparison of SUnit and RSpec for Ruby. Happy reading! This will be my last post for 2024. Happy holidays and all the best for 2025. Ciao, Koen
The difference between âexampleâ and âtestâ is trivial, except that Smalltalk already uses âexampleâ for, well, examples. Sample code that is intended to be read and imitated, not run for testing. The difference between âexpectâ and âassertâ is that âexpectâ asserts what to expect while âassertâ asserts what to expect. I hope that is clear. A ârich expectation languageâ doesnât strike me as a virtue. It has been a long time since I regarded ârich formatting languagesâ like Fortran or Common Lisp have as a good idea. Give me the basic building blocks I can freely combine using my existing programming language. Indeed, that was one of the great merits of sUnit: if you understand Smalltalk you understand the test cases without having to learn a whole ânother ârich languageâ. As for the logging, there are two fairly clear issues. Nothing stops you constructing such logs in Smalltalk. We could add a suitable âself log: textâ message to sUnit, which would make localisation easier. We could use pragmas. But the second point is that nothing ensuresthat such messages are true or accurate. For example, #pop DOESNâT remove the last item added to a stack, and whatâs more it shouldnât. It removes the most recently added REMAINING item, which is not at all the same thing. As for âsubjectâ, just as test cases normally check mutual consistency of multiple methods, so it is not unusual for a test case to relate to multiple objects. For example, to test the #copy method of some class, I might make an instance, copy it, change one of the copies, and check that the other did not change. Which one is *the* subject? I like a programming language that makes me think, but not one that tries to tell me how to think. Comparing RSpec with sUnit, I feel that RSpec is trying to canalise my thinking, while sUnit offers me possibilities. Above all, sUnit lets me extend it without drama. On Mon, 30 Dec 2024 at 5:01â¯AM, Koen De Hondt <koen@all-objects-all-the-time.st> wrote:
Dear Pharo users and developers,
After my previous blog post on SUnit, I added a follow-up post <https://all-objects-all-the-time.st/#/blog/posts/11> on the comparison of SUnit and RSpec for Ruby.
Happy reading!
This will be my last post for 2024. Happy holidays and all the best for 2025.
Ciao, Koen
participants (2)
-
Koen De Hondt -
Richard O'Keefe