|
1 | 1 | require 'minitest/autorun'
|
2 | 2 | require_relative 'kindergarten_garden'
|
3 | 3 |
|
4 |
| -class GardenTest < Minitest::Test |
5 |
| - def test_alices_garden |
| 4 | +class KindergartenGardenTest < Minitest::Test |
| 5 | + def test_partial_garden_garden_with_single_student |
| 6 | + # skip |
6 | 7 | garden = Garden.new("RC\nGG")
|
7 | 8 | assert_equal %i[radishes clover grass grass], garden.alice
|
8 | 9 | end
|
9 | 10 |
|
10 |
| - def test_different_garden_for_alice |
| 11 | + def test_partial_garden_different_garden_with_single_student |
11 | 12 | skip
|
12 | 13 | garden = Garden.new("VC\nRC")
|
13 | 14 | assert_equal %i[violets clover radishes clover], garden.alice
|
14 | 15 | end
|
15 | 16 |
|
16 |
| - def test_bobs_garden |
| 17 | + def test_partial_garden_garden_with_two_students |
17 | 18 | skip
|
18 | 19 | garden = Garden.new("VVCG\nVVRC")
|
19 | 20 | assert_equal %i[clover grass radishes clover], garden.bob
|
20 | 21 | end
|
21 | 22 |
|
22 |
| - def test_bob_and_charlies_gardens |
| 23 | + def test_partial_garden_multiple_students_for_the_same_garden_with_three_students_second_students_garden |
23 | 24 | skip
|
24 | 25 | garden = Garden.new("VVCCGG\nVVCCGG")
|
25 | 26 | assert_equal %i[clover clover clover clover], garden.bob
|
26 |
| - assert_equal %i[grass grass grass grass], garden.charlie |
27 | 27 | end
|
28 |
| -end |
29 | 28 |
|
30 |
| -class TestFullGarden < Minitest::Test |
31 |
| - def setup |
| 29 | + def test_partial_garden_multiple_students_for_the_same_garden_with_three_students_third_students_garden |
32 | 30 | skip
|
33 |
| - diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" |
34 |
| - @garden = Garden.new(diagram) |
| 31 | + garden = Garden.new("VVCCGG\nVVCCGG") |
| 32 | + assert_equal %i[grass grass grass grass], garden.charlie |
35 | 33 | end
|
36 | 34 |
|
37 |
| - attr_reader :garden |
38 |
| - |
39 |
| - def test_alice |
| 35 | + def test_full_garden_for_alice_first_students_garden |
40 | 36 | skip
|
| 37 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
41 | 38 | assert_equal %i[violets radishes violets radishes], garden.alice
|
42 | 39 | end
|
43 | 40 |
|
44 |
| - def test_bob |
| 41 | + def test_full_garden_for_bob_second_students_garden |
45 | 42 | skip
|
| 43 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
46 | 44 | assert_equal %i[clover grass clover clover], garden.bob
|
47 | 45 | end
|
48 | 46 |
|
49 |
| - def test_charlie |
| 47 | + def test_full_garden_for_charlie |
50 | 48 | skip
|
| 49 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
51 | 50 | assert_equal %i[violets violets clover grass], garden.charlie
|
52 | 51 | end
|
53 | 52 |
|
54 |
| - def test_david |
| 53 | + def test_full_garden_for_david |
55 | 54 | skip
|
| 55 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
56 | 56 | assert_equal %i[radishes violets clover radishes], garden.david
|
57 | 57 | end
|
58 | 58 |
|
59 |
| - def test_eve |
| 59 | + def test_full_garden_for_eve |
60 | 60 | skip
|
| 61 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
61 | 62 | assert_equal %i[clover grass radishes grass], garden.eve
|
62 | 63 | end
|
63 | 64 |
|
64 |
| - def test_fred |
| 65 | + def test_full_garden_for_fred |
65 | 66 | skip
|
| 67 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
66 | 68 | assert_equal %i[grass clover violets clover], garden.fred
|
67 | 69 | end
|
68 | 70 |
|
69 |
| - def test_ginny |
| 71 | + def test_full_garden_for_ginny |
70 | 72 | skip
|
| 73 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
71 | 74 | assert_equal %i[clover grass grass clover], garden.ginny
|
72 | 75 | end
|
73 | 76 |
|
74 |
| - def test_harriet |
| 77 | + def test_full_garden_for_harriet |
75 | 78 | skip
|
| 79 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
76 | 80 | assert_equal %i[violets radishes radishes violets], garden.harriet
|
77 | 81 | end
|
78 | 82 |
|
79 |
| - def test_ileana |
| 83 | + def test_full_garden_for_ileana |
80 | 84 | skip
|
| 85 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
81 | 86 | assert_equal %i[grass clover violets clover], garden.ileana
|
82 | 87 | end
|
83 | 88 |
|
84 |
| - def test_joseph |
| 89 | + def test_full_garden_for_joseph |
85 | 90 | skip
|
| 91 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
86 | 92 | assert_equal %i[violets clover violets grass], garden.joseph
|
87 | 93 | end
|
88 | 94 |
|
89 |
| - def test_kincaid |
| 95 | + def test_full_garden_for_kincaid_second_to_last_students_garden |
90 | 96 | skip
|
| 97 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
91 | 98 | assert_equal %i[grass clover clover grass], garden.kincaid
|
92 | 99 | end
|
93 | 100 |
|
94 |
| - def test_larry |
| 101 | + def test_full_garden_for_larry_last_students_garden |
95 | 102 | skip
|
| 103 | + garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") |
96 | 104 | assert_equal %i[grass violets clover violets], garden.larry
|
97 | 105 | end
|
98 | 106 | end
|
99 |
| - |
100 |
| -class DisorderedTest < Minitest::Test |
101 |
| - def setup |
102 |
| - skip |
103 |
| - diagram = "VCRRGVRG\nRVGCCGCV" |
104 |
| - students = %w[Samantha Patricia Xander Roger] |
105 |
| - @garden = Garden.new(diagram, students) |
106 |
| - end |
107 |
| - |
108 |
| - attr_reader :garden |
109 |
| - |
110 |
| - def test_patricia |
111 |
| - skip |
112 |
| - assert_equal %i[violets clover radishes violets], garden.patricia |
113 |
| - end |
114 |
| - |
115 |
| - def test_roger |
116 |
| - skip |
117 |
| - assert_equal %i[radishes radishes grass clover], garden.roger |
118 |
| - end |
119 |
| - |
120 |
| - def test_samantha |
121 |
| - skip |
122 |
| - assert_equal %i[grass violets clover grass], garden.samantha |
123 |
| - end |
124 |
| - |
125 |
| - def test_xander |
126 |
| - skip |
127 |
| - assert_equal %i[radishes grass clover violets], garden.xander |
128 |
| - end |
129 |
| -end |
130 |
| - |
131 |
| -class TwoGardensDifferentStudents < Minitest::Test |
132 |
| - def diagram |
133 |
| - "VCRRGVRG\nRVGCCGCV" |
134 |
| - end |
135 |
| - |
136 |
| - def garden1 |
137 |
| - @garden1 ||= Garden.new(diagram, %w[Alice Bob Charlie Dan]) |
138 |
| - end |
139 |
| - |
140 |
| - def garden2 |
141 |
| - @garden2 ||= Garden.new(diagram, %w[Bob Charlie Dan Erin]) |
142 |
| - end |
143 |
| - |
144 |
| - def test_bob_and_charlie_per_garden |
145 |
| - skip |
146 |
| - assert_equal %i[radishes radishes grass clover], garden1.bob |
147 |
| - assert_equal %i[violets clover radishes violets], garden2.bob |
148 |
| - assert_equal %i[grass violets clover grass], garden1.charlie |
149 |
| - assert_equal %i[radishes radishes grass clover], garden2.charlie |
150 |
| - end |
151 |
| -end |
0 commit comments