|
| 1 | +(ns food-chain-test |
| 2 | + (:require [clojure.test :refer [deftest testing is]] |
| 3 | + [clojure.string :as str] |
| 4 | + food-chain)) |
| 5 | + |
| 6 | +(deftest recite_test_1 |
| 7 | + (testing "fly" |
| 8 | + (is (= (str/join "\n" ["I know an old lady who swallowed a fly." |
| 9 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 10 | + (food-chain/recite 1 1))))) |
| 11 | + |
| 12 | +(deftest recite_test_2 |
| 13 | + (testing "spider" |
| 14 | + (is (= (str/join "\n" ["I know an old lady who swallowed a spider." |
| 15 | + "It wriggled and jiggled and tickled inside her." |
| 16 | + "She swallowed the spider to catch the fly." |
| 17 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 18 | + (food-chain/recite 2 2))))) |
| 19 | + |
| 20 | +(deftest recite_test_3 |
| 21 | + (testing "bird" |
| 22 | + (is (= (str/join "\n" ["I know an old lady who swallowed a bird." |
| 23 | + "How absurd to swallow a bird!" |
| 24 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 25 | + "She swallowed the spider to catch the fly." |
| 26 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 27 | + (food-chain/recite 3 3))))) |
| 28 | + |
| 29 | +(deftest recite_test_4 |
| 30 | + (testing "cat" |
| 31 | + (is (= (str/join "\n" ["I know an old lady who swallowed a cat." |
| 32 | + "Imagine that, to swallow a cat!" |
| 33 | + "She swallowed the cat to catch the bird." |
| 34 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 35 | + "She swallowed the spider to catch the fly." |
| 36 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 37 | + (food-chain/recite 4 4))))) |
| 38 | + |
| 39 | +(deftest recite_test_5 |
| 40 | + (testing "dog" |
| 41 | + (is (= (str/join "\n" ["I know an old lady who swallowed a dog." |
| 42 | + "What a hog, to swallow a dog!" |
| 43 | + "She swallowed the dog to catch the cat." |
| 44 | + "She swallowed the cat to catch the bird." |
| 45 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 46 | + "She swallowed the spider to catch the fly." |
| 47 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 48 | + (food-chain/recite 5 5))))) |
| 49 | + |
| 50 | +(deftest recite_test_6 |
| 51 | + (testing "goat" |
| 52 | + (is (= (str/join "\n" ["I know an old lady who swallowed a goat." |
| 53 | + "Just opened her throat and swallowed a goat!" |
| 54 | + "She swallowed the goat to catch the dog." |
| 55 | + "She swallowed the dog to catch the cat." |
| 56 | + "She swallowed the cat to catch the bird." |
| 57 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 58 | + "She swallowed the spider to catch the fly." |
| 59 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 60 | + (food-chain/recite 6 6))))) |
| 61 | + |
| 62 | +(deftest recite_test_7 |
| 63 | + (testing "cow" |
| 64 | + (is (= (str/join "\n" ["I know an old lady who swallowed a cow." |
| 65 | + "I don't know how she swallowed a cow!" |
| 66 | + "She swallowed the cow to catch the goat." |
| 67 | + "She swallowed the goat to catch the dog." |
| 68 | + "She swallowed the dog to catch the cat." |
| 69 | + "She swallowed the cat to catch the bird." |
| 70 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 71 | + "She swallowed the spider to catch the fly." |
| 72 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 73 | + (food-chain/recite 7 7))))) |
| 74 | + |
| 75 | +(deftest recite_test_8 |
| 76 | + (testing "horse" |
| 77 | + (is (= (str/join "\n" ["I know an old lady who swallowed a horse." |
| 78 | + "She's dead, of course!"]) |
| 79 | + (food-chain/recite 8 8))))) |
| 80 | + |
| 81 | +(deftest recite_test_9 |
| 82 | + (testing "multiple verses" |
| 83 | + (is (= (str/join "\n" ["I know an old lady who swallowed a fly." |
| 84 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 85 | + "" |
| 86 | + "I know an old lady who swallowed a spider." |
| 87 | + "It wriggled and jiggled and tickled inside her." |
| 88 | + "She swallowed the spider to catch the fly." |
| 89 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 90 | + "" |
| 91 | + "I know an old lady who swallowed a bird." |
| 92 | + "How absurd to swallow a bird!" |
| 93 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 94 | + "She swallowed the spider to catch the fly." |
| 95 | + "I don't know why she swallowed the fly. Perhaps she'll die."]) |
| 96 | + (food-chain/recite 1 3))))) |
| 97 | + |
| 98 | +(deftest recite_test_10 |
| 99 | + (testing "full song" |
| 100 | + (is (= (str/join "\n" ["I know an old lady who swallowed a fly." |
| 101 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 102 | + "" |
| 103 | + "I know an old lady who swallowed a spider." |
| 104 | + "It wriggled and jiggled and tickled inside her." |
| 105 | + "She swallowed the spider to catch the fly." |
| 106 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 107 | + "" |
| 108 | + "I know an old lady who swallowed a bird." |
| 109 | + "How absurd to swallow a bird!" |
| 110 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 111 | + "She swallowed the spider to catch the fly." |
| 112 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 113 | + "" |
| 114 | + "I know an old lady who swallowed a cat." |
| 115 | + "Imagine that, to swallow a cat!" |
| 116 | + "She swallowed the cat to catch the bird." |
| 117 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 118 | + "She swallowed the spider to catch the fly." |
| 119 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 120 | + "" |
| 121 | + "I know an old lady who swallowed a dog." |
| 122 | + "What a hog, to swallow a dog!" |
| 123 | + "She swallowed the dog to catch the cat." |
| 124 | + "She swallowed the cat to catch the bird." |
| 125 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 126 | + "She swallowed the spider to catch the fly." |
| 127 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 128 | + "" |
| 129 | + "I know an old lady who swallowed a goat." |
| 130 | + "Just opened her throat and swallowed a goat!" |
| 131 | + "She swallowed the goat to catch the dog." |
| 132 | + "She swallowed the dog to catch the cat." |
| 133 | + "She swallowed the cat to catch the bird." |
| 134 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 135 | + "She swallowed the spider to catch the fly." |
| 136 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 137 | + "" |
| 138 | + "I know an old lady who swallowed a cow." |
| 139 | + "I don't know how she swallowed a cow!" |
| 140 | + "She swallowed the cow to catch the goat." |
| 141 | + "She swallowed the goat to catch the dog." |
| 142 | + "She swallowed the dog to catch the cat." |
| 143 | + "She swallowed the cat to catch the bird." |
| 144 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 145 | + "She swallowed the spider to catch the fly." |
| 146 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 147 | + "" |
| 148 | + "I know an old lady who swallowed a horse." |
| 149 | + "She's dead, of course!"]) |
| 150 | + (food-chain/recite 1 8))))) |
0 commit comments