Sha256: 9f0d3ff8bed2af50f24827588c373a7cd47fe07e87970a57aaf3aa943cf14977
Contents?: true
Size: 1010 Bytes
Versions: 213
Compression:
Stored size: 1010 Bytes
Contents
;;; robot-name-test.el --- Tests for Robot Name (exercism) ;;; Commentary: ;; Ported pretty much directly from the xlisp version :) ;;; Code: (require 'rx) (load-file "robot-name.el") (defvar *robbie* (build-robot)) (defvar *clutz* (build-robot)) (defvar robot-name-re (rx string-start (= 2 upper-case) (= 3 digit) string-end)) (ert-deftest name-matches-expected-pattern () (let ((name (robot-name *robbie*))) (should (string-match-p robot-name-re name)))) (ert-deftest name-is-persistent () "Test that robot name is persistent." (should (equal (robot-name *robbie*) (robot-name *robbie*)))) (ert-deftest different-robots-have-different-names () (should-not (equal (robot-name *robbie*) (robot-name *clutz*)))) (ert-deftest name-can-be-reset () (let* ((robot (build-robot)) (original-name (robot-name robot))) (reset-robot robot) (should-not (equal original-name (robot-name robot))))) (provide 'robot-name-test) ;;; robot-name-test.el ends here
Version data entries
213 entries across 213 versions & 1 rubygems