Skip to content

Commit 15d65b0

Browse files
kytrinyxkotp
authored andcommitted
Sync kindergarten-garden with problem-specifications
The sync brought in new docs and added new tests to tests.toml. The original test suite had grouped a lot of tests. Regenerating the tests created a lot more tests, but the example solution didn't need to be changed.
1 parent 65a3f40 commit 15d65b0

File tree

3 files changed

+74
-97
lines changed

3 files changed

+74
-97
lines changed

exercises/practice/kindergarten-garden/.docs/instructions.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
Given a diagram, determine which plants each child in the kindergarten class is
44
responsible for.
55

6-
The kindergarten class is learning about growing plants. The teacher
7-
thought it would be a good idea to give them actual seeds, plant them in
8-
actual dirt, and grow actual plants.
6+
The kindergarten class is learning about growing plants.
7+
The teacher thought it would be a good idea to give them actual seeds, plant them in actual dirt, and grow actual plants.
98

109
They've chosen to grow grass, clover, radishes, and violets.
1110

@@ -25,8 +24,8 @@ There are 12 children in the class:
2524
- Eve, Fred, Ginny, Harriet,
2625
- Ileana, Joseph, Kincaid, and Larry.
2726

28-
Each child gets 4 cups, two on each row. Their teacher assigns cups to
29-
the children alphabetically by their names.
27+
Each child gets 4 cups, two on each row.
28+
Their teacher assigns cups to the children alphabetically by their names.
3029

3130
The following diagram represents Alice's plants:
3231

@@ -36,12 +35,11 @@ VR......................
3635
RG......................
3736
```
3837

39-
In the first row, nearest the windows, she has a violet and a radish. In the
40-
second row she has a radish and some grass.
38+
In the first row, nearest the windows, she has a violet and a radish.
39+
In the second row she has a radish and some grass.
4140

42-
Your program will be given the plants from left-to-right starting with
43-
the row nearest the windows. From this, it should be able to determine
44-
which plants belong to each student.
41+
Your program will be given the plants from left-to-right starting with the row nearest the windows.
42+
From this, it should be able to determine which plants belong to each student.
4543

4644
For example, if it's told that the garden looks like so:
4745

exercises/practice/kindergarten-garden/.meta/tests.toml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,52 @@
1010
# is regenerated, comments can be added via a `comment` key.
1111

1212
[1fc316ed-17ab-4fba-88ef-3ae78296b692]
13-
description = "garden with single student"
13+
description = "partial garden -> garden with single student"
1414

1515
[acd19dc1-2200-4317-bc2a-08f021276b40]
16-
description = "different garden with single student"
16+
description = "partial garden -> different garden with single student"
1717

1818
[c376fcc8-349c-446c-94b0-903947315757]
19-
description = "garden with two students"
19+
description = "partial garden -> garden with two students"
2020

2121
[2d620f45-9617-4924-9d27-751c80d17db9]
22-
description = "second student's garden"
22+
description = "partial garden -> multiple students for the same garden with three students -> second student's garden"
2323

2424
[57712331-4896-4364-89f8-576421d69c44]
25-
description = "third student's garden"
25+
description = "partial garden -> multiple students for the same garden with three students -> third student's garden"
2626

2727
[149b4290-58e1-40f2-8ae4-8b87c46e765b]
28-
description = "first student's garden"
28+
description = "full garden -> for Alice, first student's garden"
2929

3030
[ba25dbbc-10bd-4a37-b18e-f89ecd098a5e]
31-
description = "second student's garden"
31+
description = "full garden -> for Bob, second student's garden"
32+
33+
[566b621b-f18e-4c5f-873e-be30544b838c]
34+
description = "full garden -> for Charlie"
35+
36+
[3ad3df57-dd98-46fc-9269-1877abf612aa]
37+
description = "full garden -> for David"
38+
39+
[0f0a55d1-9710-46ed-a0eb-399ba8c72db2]
40+
description = "full garden -> for Eve"
41+
42+
[a7e80c90-b140-4ea1-aee3-f4625365c9a4]
43+
description = "full garden -> for Fred"
44+
45+
[9d94b273-2933-471b-86e8-dba68694c615]
46+
description = "full garden -> for Ginny"
47+
48+
[f55bc6c2-ade8-4844-87c4-87196f1b7258]
49+
description = "full garden -> for Harriet"
50+
51+
[759070a3-1bb1-4dd4-be2c-7cce1d7679ae]
52+
description = "full garden -> for Ileana"
53+
54+
[78578123-2755-4d4a-9c7d-e985b8dda1c6]
55+
description = "full garden -> for Joseph"
3256

3357
[6bb66df7-f433-41ab-aec2-3ead6e99f65b]
34-
description = "second to last student's garden"
58+
description = "full garden -> for Kincaid, second to last student's garden"
3559

3660
[d7edec11-6488-418a-94e6-ed509e0fa7eb]
37-
description = "last student's garden"
61+
description = "full garden -> for Larry, last student's garden"
Lines changed: 33 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,106 @@
11
require 'minitest/autorun'
22
require_relative 'kindergarten_garden'
33

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
67
garden = Garden.new("RC\nGG")
78
assert_equal %i[radishes clover grass grass], garden.alice
89
end
910

10-
def test_different_garden_for_alice
11+
def test_partial_garden_different_garden_with_single_student
1112
skip
1213
garden = Garden.new("VC\nRC")
1314
assert_equal %i[violets clover radishes clover], garden.alice
1415
end
1516

16-
def test_bobs_garden
17+
def test_partial_garden_garden_with_two_students
1718
skip
1819
garden = Garden.new("VVCG\nVVRC")
1920
assert_equal %i[clover grass radishes clover], garden.bob
2021
end
2122

22-
def test_bob_and_charlies_gardens
23+
def test_partial_garden_multiple_students_for_the_same_garden_with_three_students_second_students_garden
2324
skip
2425
garden = Garden.new("VVCCGG\nVVCCGG")
2526
assert_equal %i[clover clover clover clover], garden.bob
26-
assert_equal %i[grass grass grass grass], garden.charlie
2727
end
28-
end
2928

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
3230
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
3533
end
3634

37-
attr_reader :garden
38-
39-
def test_alice
35+
def test_full_garden_for_alice_first_students_garden
4036
skip
37+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
4138
assert_equal %i[violets radishes violets radishes], garden.alice
4239
end
4340

44-
def test_bob
41+
def test_full_garden_for_bob_second_students_garden
4542
skip
43+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
4644
assert_equal %i[clover grass clover clover], garden.bob
4745
end
4846

49-
def test_charlie
47+
def test_full_garden_for_charlie
5048
skip
49+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
5150
assert_equal %i[violets violets clover grass], garden.charlie
5251
end
5352

54-
def test_david
53+
def test_full_garden_for_david
5554
skip
55+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
5656
assert_equal %i[radishes violets clover radishes], garden.david
5757
end
5858

59-
def test_eve
59+
def test_full_garden_for_eve
6060
skip
61+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
6162
assert_equal %i[clover grass radishes grass], garden.eve
6263
end
6364

64-
def test_fred
65+
def test_full_garden_for_fred
6566
skip
67+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
6668
assert_equal %i[grass clover violets clover], garden.fred
6769
end
6870

69-
def test_ginny
71+
def test_full_garden_for_ginny
7072
skip
73+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
7174
assert_equal %i[clover grass grass clover], garden.ginny
7275
end
7376

74-
def test_harriet
77+
def test_full_garden_for_harriet
7578
skip
79+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
7680
assert_equal %i[violets radishes radishes violets], garden.harriet
7781
end
7882

79-
def test_ileana
83+
def test_full_garden_for_ileana
8084
skip
85+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
8186
assert_equal %i[grass clover violets clover], garden.ileana
8287
end
8388

84-
def test_joseph
89+
def test_full_garden_for_joseph
8590
skip
91+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
8692
assert_equal %i[violets clover violets grass], garden.joseph
8793
end
8894

89-
def test_kincaid
95+
def test_full_garden_for_kincaid_second_to_last_students_garden
9096
skip
97+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
9198
assert_equal %i[grass clover clover grass], garden.kincaid
9299
end
93100

94-
def test_larry
101+
def test_full_garden_for_larry_last_students_garden
95102
skip
103+
garden = Garden.new("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
96104
assert_equal %i[grass violets clover violets], garden.larry
97105
end
98106
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

Comments
 (0)