Sha256: 1a5a28fb26fbb4587c991001c6ec0e06cd080bf8ebcae8ae880604fcc115d419

Contents?: true

Size: 1.86 KB

Versions: 354

Compression:

Stored size: 1.86 KB

Contents

;;; bob-test.el --- ERT tests for Bob (exercism)

;;; Commentary:

;;; Code:

(load-file "bob.el")


(ert-deftest responds-to-something ()
  (should (string= "Whatever." (response-for "Tom-ay-to, tom-aaaah-to."))))

(ert-deftest responds-to-shouts ()
  (should
   (string= "Whoa, chill out!" (response-for "WATCH OUT!"))))

(ert-deftest responds-to-questions ()
  (should
   (string= "Sure." (response-for "Does this cryogenic chamber make me look fat?"))))

(ert-deftest responds-to-forceful-talking ()
  (should
   (string= "Whatever." (response-for "Let's go make out behind the gym!"))))

(ert-deftest responds-to-acronyms ()
  (should
   (string= "Whatever." (response-for "It's OK if you don't want to go to the DMV."))))

(ert-deftest responds-to-forceful-questions ()
  (should
   (string= "Whoa, chill out!" (response-for "WHAT THE HELL WERE YOU THINKING?"))))

(ert-deftest responds-to-shouting-with-special-chars ()
  (should
   (string= "Whoa, chill out!" (response-for "ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"))))

(ert-deftest responds-to-shouting-numbers ()
  (should
   (string= "Whoa, chill out!" (response-for "1, 2, 3, GO!"))))

(ert-deftest responds-to-shouting-with-no-exclamation-mark ()
  (should
   (string= "Whoa, chill out!" (response-for "I HATE YOU"))))

(ert-deftest responds-to-statement-containing-question-mark ()
  (should
   (string= "Whatever." (response-for "Ending with ? means a question."))))

(ert-deftest responds-to-silence ()
  (should
   (string= "Fine. Be that way!" (response-for ""))))

(ert-deftest responds-to-prolonged-silence ()
  (should
   (string= "Fine. Be that way!" (response-for "    "))))

(ert-deftest responds-to-only-numbers ()
  (should
   (string= "Whatever." (response-for "1, 2, 3"))))

(ert-deftest responds-to-number-questions ()
  (should
   (string= "Sure." (response-for "4?"))))

(provide 'bob-test)
;;;bob-test.el ends here

Version data entries

354 entries across 354 versions & 1 rubygems

Version Path
trackler-2.2.1.137 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.136 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.135 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.134 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.133 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.132 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.131 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.130 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.129 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.128 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.127 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.126 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.125 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.124 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.123 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.122 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.121 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.120 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.119 tracks/elisp/exercises/bob/bob-test.el
trackler-2.2.1.118 tracks/elisp/exercises/bob/bob-test.el