clojure icon indicating copy to clipboard operation
clojure copied to clipboard

Tests in Robot Simulator are overly prescriptive

Open cstby opened this issue 4 years ago • 1 comments

The robot simulator exercise contains two tests that cause problems for students.

(deftest can-turn-right
  (is (= :north (robot-simulator/turn-right :west))))

(deftest can-turn-left
  (is (= :west  (robot-simulator/turn-left :north))))

A completely valid approach would be for turn-left and turn-right to accept a robot as input and produce a robot as output. However, the tests preclude this approach to solving the exercise. I would advocate for removing these tests.

cstby avatar Jan 01 '22 04:01 cstby

@cstby I like the way you're thinking. Would removing just those 2 deftests do the trick?

bobbicodes avatar Jan 27 '22 19:01 bobbicodes

I agree, these two tests don't really serve any purpose. I can sync with the current specs and use the correct way to test if the robot turns correctly.

@bobbicodes I'll PR this.

tasxatzial avatar Jul 12 '23 10:07 tasxatzial