|
3 | 3 | require 'minitest/autorun'
|
4 | 4 | require_relative 'pig_latin'
|
5 | 5 |
|
| 6 | +# Common test data version: d4e9a22 |
6 | 7 | class PigLatinTest < Minitest::Test
|
7 | 8 | def test_word_beginning_with_a
|
8 |
| - assert_equal 'appleay', PigLatin.translate('apple') |
| 9 | + # skip |
| 10 | + assert_equal "appleay", PigLatin.translate("apple") |
9 | 11 | end
|
10 | 12 |
|
11 |
| - def test_other_word_beginning_e |
| 13 | + def test_word_beginning_with_e |
12 | 14 | skip
|
13 |
| - assert_equal 'earay', PigLatin.translate('ear') |
| 15 | + assert_equal "earay", PigLatin.translate("ear") |
| 16 | + end |
| 17 | + |
| 18 | + def test_word_beginning_with_i |
| 19 | + skip |
| 20 | + assert_equal "iglooay", PigLatin.translate("igloo") |
| 21 | + end |
| 22 | + |
| 23 | + def test_word_beginning_with_o |
| 24 | + skip |
| 25 | + assert_equal "objectay", PigLatin.translate("object") |
| 26 | + end |
| 27 | + |
| 28 | + def test_word_beginning_with_u |
| 29 | + skip |
| 30 | + assert_equal "underay", PigLatin.translate("under") |
| 31 | + end |
| 32 | + |
| 33 | + def test_word_beginning_with_a_vowel_and_followed_by_a_qu |
| 34 | + skip |
| 35 | + assert_equal "equalay", PigLatin.translate("equal") |
14 | 36 | end
|
15 | 37 |
|
16 | 38 | def test_word_beginning_with_p
|
17 | 39 | skip
|
18 |
| - assert_equal 'igpay', PigLatin.translate('pig') |
| 40 | + assert_equal "igpay", PigLatin.translate("pig") |
19 | 41 | end
|
20 | 42 |
|
21 | 43 | def test_word_beginning_with_k
|
22 | 44 | skip
|
23 |
| - assert_equal 'oalakay', PigLatin.translate('koala') |
| 45 | + assert_equal "oalakay", PigLatin.translate("koala") |
| 46 | + end |
| 47 | + |
| 48 | + def test_word_beginning_with_y |
| 49 | + skip |
| 50 | + assert_equal "ellowyay", PigLatin.translate("yellow") |
| 51 | + end |
| 52 | + |
| 53 | + def test_word_beginning_with_x |
| 54 | + skip |
| 55 | + assert_equal "enonxay", PigLatin.translate("xenon") |
| 56 | + end |
| 57 | + |
| 58 | + def test_word_beginning_with_q_without_a_following_u |
| 59 | + skip |
| 60 | + assert_equal "atqay", PigLatin.translate("qat") |
24 | 61 | end
|
25 | 62 |
|
26 | 63 | def test_word_beginning_with_ch
|
27 | 64 | skip
|
28 |
| - assert_equal 'airchay', PigLatin.translate('chair') |
| 65 | + assert_equal "airchay", PigLatin.translate("chair") |
29 | 66 | end
|
30 | 67 |
|
31 | 68 | def test_word_beginning_with_qu
|
32 | 69 | skip
|
33 |
| - assert_equal 'eenquay', PigLatin.translate('queen') |
| 70 | + assert_equal "eenquay", PigLatin.translate("queen") |
34 | 71 | end
|
35 | 72 |
|
36 |
| - def test_word_with_consonant_preceding_qu |
| 73 | + def test_word_beginning_with_qu_and_a_preceding_consonant |
37 | 74 | skip
|
38 |
| - assert_equal 'aresquay', PigLatin.translate('square') |
| 75 | + assert_equal "aresquay", PigLatin.translate("square") |
39 | 76 | end
|
40 | 77 |
|
41 | 78 | def test_word_beginning_with_th
|
42 | 79 | skip
|
43 |
| - assert_equal 'erapythay', PigLatin.translate('therapy') |
| 80 | + assert_equal "erapythay", PigLatin.translate("therapy") |
44 | 81 | end
|
45 | 82 |
|
46 | 83 | def test_word_beginning_with_thr
|
47 | 84 | skip
|
48 |
| - assert_equal 'ushthray', PigLatin.translate('thrush') |
| 85 | + assert_equal "ushthray", PigLatin.translate("thrush") |
49 | 86 | end
|
50 | 87 |
|
51 | 88 | def test_word_beginning_with_sch
|
52 | 89 | skip
|
53 |
| - assert_equal 'oolschay', PigLatin.translate('school') |
| 90 | + assert_equal "oolschay", PigLatin.translate("school") |
54 | 91 | end
|
55 | 92 |
|
56 |
| - def test_translates_phrase |
| 93 | + def test_word_beginning_with_yt |
57 | 94 | skip
|
58 |
| - assert_equal 'ickquay astfay unray', PigLatin.translate('quick fast run') |
| 95 | + assert_equal "yttriaay", PigLatin.translate("yttria") |
59 | 96 | end
|
60 | 97 |
|
61 |
| - def test_word_beginning_with_ye |
| 98 | + def test_word_beginning_with_xr |
62 | 99 | skip
|
63 |
| - assert_equal 'ellowyay', PigLatin.translate('yellow') |
| 100 | + assert_equal "xrayay", PigLatin.translate("xray") |
64 | 101 | end
|
65 | 102 |
|
66 |
| - def test_word_beginning_with_yt |
| 103 | + def test_a_whole_phrase |
67 | 104 | skip
|
68 |
| - assert_equal 'yttriaay', PigLatin.translate('yttria') |
| 105 | + assert_equal "ickquay astfay unray", PigLatin.translate("quick fast run") |
69 | 106 | end
|
70 | 107 |
|
71 |
| - def test_word_beginning_with_xe |
72 |
| - skip |
73 |
| - assert_equal 'enonxay', PigLatin.translate('xenon') |
74 |
| - end |
| 108 | + # Problems in exercism evolve over time, as we find better ways to ask |
| 109 | + # questions. |
| 110 | + # The version number refers to the version of the problem you solved, |
| 111 | + # not your solution. |
| 112 | + # |
| 113 | + # Define a constant named VERSION inside of the top level BookKeeping |
| 114 | + # module, which may be placed near the end of your file. |
| 115 | + # |
| 116 | + # In your file, it will look like this: |
| 117 | + # |
| 118 | + # module BookKeeping |
| 119 | + # VERSION = 1 # Where the version number matches the one in the test. |
| 120 | + # end |
| 121 | + # |
| 122 | + # If you are curious, read more about constants on RubyDoc: |
| 123 | + # http://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html |
75 | 124 |
|
76 |
| - def test_word_beginning_with_xr |
| 125 | + def test_bookkeeping |
77 | 126 | skip
|
78 |
| - assert_equal 'xrayay', PigLatin.translate('xray') |
| 127 | + assert_equal 1, BookKeeping::VERSION |
79 | 128 | end
|
80 | 129 | end
|
0 commit comments