Sha256: fd94197683f9b679da551875b430f6d0c98126e4a914a142577b148c093b59b6

Contents?: true

Size: 1.02 KB

Versions: 19

Compression:

Stored size: 1.02 KB

Contents

(ns robot-name-test
  (:require [clojure.test :refer [deftest is testing]]
            robot-name))

(def ^:private robbie (robot-name/robot))
(def ^:private clutz  (robot-name/robot))

(deftest robot-name
  (testing "robot-name"
    (is (re-seq #"[A-Z]{2}\d{3}" (robot-name/robot-name robbie))
        "name matches expected pattern")
    (is (= (robot-name/robot-name robbie) (robot-name/robot-name robbie))
        "name is persistent")
    (is (not= (robot-name/robot-name clutz) (robot-name/robot-name robbie))
        "different robots have different names")))

(deftest reset-name
  (testing "reset-name"
    (let [original-name (robot-name/robot-name robbie)]
      (robot-name/reset-name robbie)
      (is (re-seq #"[A-Z]{2}\d{3}" (robot-name/robot-name robbie))
          "new name matches expected pattern")
      (is (= (robot-name/robot-name robbie) (robot-name/robot-name robbie))
          "new name is persistent")
      (is (not= original-name (robot-name/robot-name robbie))
          "new name is different from old name"))))

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
trackler-2.0.0.8 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.7 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.6 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.5 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.4 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.3 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.2 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.1 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-2.0.0.0 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.4.1 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.4.0 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.3.0 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.2.1 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.2.0 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.1.2 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.1.1 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.1.0 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.0.1 tracks/clojure/exercises/robot-name/test/robot_name_test.clj
trackler-1.0.0 tracks/clojure/exercises/robot-name/test/robot_name_test.clj