|
| 1 | +FoodChain = require './food-chain' |
| 2 | + |
| 3 | +describe 'Food Chain', -> |
| 4 | + it 'fly', -> |
| 5 | + expected = [ |
| 6 | + "I know an old lady who swallowed a fly." |
| 7 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 8 | + ].join "\n" |
| 9 | + expect(FoodChain.recite 1, 1).toEqual expected |
| 10 | + |
| 11 | + xit 'spider', -> |
| 12 | + expected = [ |
| 13 | + "I know an old lady who swallowed a spider." |
| 14 | + "It wriggled and jiggled and tickled inside her." |
| 15 | + "She swallowed the spider to catch the fly." |
| 16 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 17 | + ].join "\n" |
| 18 | + expect(FoodChain.recite 2, 2).toEqual expected |
| 19 | + |
| 20 | + xit 'bird', -> |
| 21 | + expected = [ |
| 22 | + "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 | + ].join "\n" |
| 28 | + expect(FoodChain.recite 3, 3).toEqual expected |
| 29 | + |
| 30 | + xit 'cat', -> |
| 31 | + expected = [ |
| 32 | + "I know an old lady who swallowed a cat." |
| 33 | + "Imagine that, to swallow a cat!" |
| 34 | + "She swallowed the cat to catch the bird." |
| 35 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 36 | + "She swallowed the spider to catch the fly." |
| 37 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 38 | + ].join "\n" |
| 39 | + expect(FoodChain.recite 4, 4).toEqual expected |
| 40 | + |
| 41 | + xit 'dog', -> |
| 42 | + expected = [ |
| 43 | + "I know an old lady who swallowed a dog." |
| 44 | + "What a hog, to swallow a dog!" |
| 45 | + "She swallowed the dog to catch the cat." |
| 46 | + "She swallowed the cat to catch the bird." |
| 47 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 48 | + "She swallowed the spider to catch the fly." |
| 49 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 50 | + ].join "\n" |
| 51 | + expect(FoodChain.recite 5, 5).toEqual expected |
| 52 | + |
| 53 | + xit 'goat', -> |
| 54 | + expected = [ |
| 55 | + "I know an old lady who swallowed a goat." |
| 56 | + "Just opened her throat and swallowed a goat!" |
| 57 | + "She swallowed the goat to catch the dog." |
| 58 | + "She swallowed the dog to catch the cat." |
| 59 | + "She swallowed the cat to catch the bird." |
| 60 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 61 | + "She swallowed the spider to catch the fly." |
| 62 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 63 | + ].join "\n" |
| 64 | + expect(FoodChain.recite 6, 6).toEqual expected |
| 65 | + |
| 66 | + xit 'cow', -> |
| 67 | + expected = [ |
| 68 | + "I know an old lady who swallowed a cow." |
| 69 | + "I don't know how she swallowed a cow!" |
| 70 | + "She swallowed the cow to catch the goat." |
| 71 | + "She swallowed the goat to catch the dog." |
| 72 | + "She swallowed the dog to catch the cat." |
| 73 | + "She swallowed the cat to catch the bird." |
| 74 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 75 | + "She swallowed the spider to catch the fly." |
| 76 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 77 | + ].join "\n" |
| 78 | + expect(FoodChain.recite 7, 7).toEqual expected |
| 79 | + |
| 80 | + xit 'horse', -> |
| 81 | + expected = [ |
| 82 | + "I know an old lady who swallowed a horse." |
| 83 | + "She's dead, of course!" |
| 84 | + ].join "\n" |
| 85 | + expect(FoodChain.recite 8, 8).toEqual expected |
| 86 | + |
| 87 | + xit 'multiple verses', -> |
| 88 | + expected = [ |
| 89 | + "I know an old lady who swallowed a fly." |
| 90 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 91 | + "" |
| 92 | + "I know an old lady who swallowed a spider." |
| 93 | + "It 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 | + "" |
| 97 | + "I know an old lady who swallowed a bird." |
| 98 | + "How absurd to swallow a bird!" |
| 99 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 100 | + "She swallowed the spider to catch the fly." |
| 101 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 102 | + ].join "\n" |
| 103 | + expect(FoodChain.recite 1, 3).toEqual expected |
| 104 | + |
| 105 | + xit 'full song', -> |
| 106 | + expected = [ |
| 107 | + "I know an old lady who swallowed a fly." |
| 108 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 109 | + "" |
| 110 | + "I know an old lady who swallowed a spider." |
| 111 | + "It wriggled and jiggled and tickled inside her." |
| 112 | + "She swallowed the spider to catch the fly." |
| 113 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 114 | + "" |
| 115 | + "I know an old lady who swallowed a bird." |
| 116 | + "How absurd to swallow a 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 cat." |
| 122 | + "Imagine that, to swallow a cat!" |
| 123 | + "She swallowed the cat to catch the bird." |
| 124 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 125 | + "She swallowed the spider to catch the fly." |
| 126 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 127 | + "" |
| 128 | + "I know an old lady who swallowed a dog." |
| 129 | + "What a hog, to swallow a dog!" |
| 130 | + "She swallowed the dog to catch the cat." |
| 131 | + "She swallowed the cat to catch the bird." |
| 132 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 133 | + "She swallowed the spider to catch the fly." |
| 134 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 135 | + "" |
| 136 | + "I know an old lady who swallowed a goat." |
| 137 | + "Just opened her throat and swallowed a goat!" |
| 138 | + "She swallowed the goat to catch the dog." |
| 139 | + "She swallowed the dog to catch the cat." |
| 140 | + "She swallowed the cat to catch the bird." |
| 141 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 142 | + "She swallowed the spider to catch the fly." |
| 143 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 144 | + "" |
| 145 | + "I know an old lady who swallowed a cow." |
| 146 | + "I don't know how she swallowed a cow!" |
| 147 | + "She swallowed the cow to catch the goat." |
| 148 | + "She swallowed the goat to catch the dog." |
| 149 | + "She swallowed the dog to catch the cat." |
| 150 | + "She swallowed the cat to catch the bird." |
| 151 | + "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her." |
| 152 | + "She swallowed the spider to catch the fly." |
| 153 | + "I don't know why she swallowed the fly. Perhaps she'll die." |
| 154 | + "" |
| 155 | + "I know an old lady who swallowed a horse." |
| 156 | + "She's dead, of course!" |
| 157 | + ].join "\n" |
| 158 | + expect(FoodChain.recite 1, 8).toEqual expected |
| 159 | + |
0 commit comments