clojure icon indicating copy to clipboard operation
clojure copied to clipboard

Eliminate implementation-specific tests

Open canweriotnow opened this issue 8 years ago • 2 comments

Inspired by a review of #149 (fix for #148) - a new test was failing based on a (IMHO) poorly constructed state atom in the robot-names exercise example; one of the beauties of Clojure, and, a fortiori, testing in Clojure is being able to test pure functions with pure functions, rather than relying on underlying implementation details for mutable state.

This issue calls for a review of all tests in @exercism/clojure and there related examples to ensure that tests only check for functionality without relying on the behavior of particular stateful constructs to pass.

canweriotnow avatar Nov 01 '16 17:11 canweriotnow

I understand this is from 5 years ago but I think it raises a strong point that likely should still be visited! I imagine that many of the unit tests were ported from other tracks without much regard for how we would actually do it ;)

bobbicodes avatar Sep 05 '21 22:09 bobbicodes

I was also very surprised to see that the tests expect reset-name to have side-effects rather than return a robot with a different name. This is unlike any clojure code I've seen

rthouvenin avatar Jun 12 '23 17:06 rthouvenin