|
| 1 | +TwelveDays = require 'twelve_days' |
| 2 | + |
| 3 | +describe 'twelve-days', -> |
| 4 | + describe 'verse', -> |
| 5 | + it 'first day a partridge in a pear tree', -> |
| 6 | + result = TwelveDays.recite 1, 1 |
| 7 | + expected = {'On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.'} |
| 8 | + assert.are.same expected, result |
| 9 | + |
| 10 | + pending 'second day two turtle doves', -> |
| 11 | + result = TwelveDays.recite 2, 2 |
| 12 | + expected = {'On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 13 | + assert.are.same expected, result |
| 14 | + |
| 15 | + pending 'third day three french hens', -> |
| 16 | + result = TwelveDays.recite 3, 3 |
| 17 | + expected = {'On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 18 | + assert.are.same expected, result |
| 19 | + |
| 20 | + pending 'fourth day four calling birds', -> |
| 21 | + result = TwelveDays.recite 4, 4 |
| 22 | + expected = {'On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 23 | + assert.are.same expected, result |
| 24 | + |
| 25 | + pending 'fifth day five gold rings', -> |
| 26 | + result = TwelveDays.recite 5, 5 |
| 27 | + expected = {'On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 28 | + assert.are.same expected, result |
| 29 | + |
| 30 | + pending 'sixth day six geese-a-laying', -> |
| 31 | + result = TwelveDays.recite 6, 6 |
| 32 | + expected = {'On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 33 | + assert.are.same expected, result |
| 34 | + |
| 35 | + pending 'seventh day seven swans-a-swimming', -> |
| 36 | + result = TwelveDays.recite 7, 7 |
| 37 | + expected = {'On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 38 | + assert.are.same expected, result |
| 39 | + |
| 40 | + pending 'eighth day eight maids-a-milking', -> |
| 41 | + result = TwelveDays.recite 8, 8 |
| 42 | + expected = {'On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 43 | + assert.are.same expected, result |
| 44 | + |
| 45 | + pending 'ninth day nine ladies dancing', -> |
| 46 | + result = TwelveDays.recite 9, 9 |
| 47 | + expected = {'On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 48 | + assert.are.same expected, result |
| 49 | + |
| 50 | + pending 'tenth day ten lords-a-leaping', -> |
| 51 | + result = TwelveDays.recite 10, 10 |
| 52 | + expected = {'On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 53 | + assert.are.same expected, result |
| 54 | + |
| 55 | + pending 'eleventh day eleven pipers piping', -> |
| 56 | + result = TwelveDays.recite 11, 11 |
| 57 | + expected = {'On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 58 | + assert.are.same expected, result |
| 59 | + |
| 60 | + pending 'twelfth day twelve drummers drumming', -> |
| 61 | + result = TwelveDays.recite 12, 12 |
| 62 | + expected = {'On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.'} |
| 63 | + assert.are.same expected, result |
| 64 | + |
| 65 | + describe 'lyrics', -> |
| 66 | + pending 'recites first three verses of the song', -> |
| 67 | + result = TwelveDays.recite 1, 3 |
| 68 | + expected = { |
| 69 | + 'On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.', |
| 70 | + 'On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.', |
| 71 | + 'On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 72 | + } |
| 73 | + assert.are.same expected, result |
| 74 | + |
| 75 | + pending 'recites three verses from the middle of the song', -> |
| 76 | + result = TwelveDays.recite 4, 6 |
| 77 | + expected = { |
| 78 | + 'On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 79 | + 'On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 80 | + 'On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 81 | + } |
| 82 | + assert.are.same expected, result |
| 83 | + |
| 84 | + pending 'recites the whole song', -> |
| 85 | + result = TwelveDays.recite 1, 12 |
| 86 | + expected = { |
| 87 | + 'On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.', |
| 88 | + 'On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.', |
| 89 | + 'On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 90 | + 'On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 91 | + 'On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 92 | + 'On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 93 | + 'On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 94 | + 'On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 95 | + 'On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 96 | + 'On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 97 | + 'On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 98 | + 'On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.', |
| 99 | + } |
| 100 | + assert.are.same expected, result |
0 commit comments