Skip to content

Commit b230408

Browse files
committed
Fix assert:empty statement
1 parent 3383a34 commit b230408

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

exercises/practice/grade-school/.meta/test_template.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class GradeSchoolTest < Minitest::Test
1010
<%- cases["input"]["students"].each do |student| -%>
1111
school.add('<%= student[0] %>', <%= student[1] %>)
1212
<%- end -%>
13-
assert_empty <%= cases["expected"] %>, school.roster
13+
assert_equal <%= cases["expected"] %>, school.roster
1414
<%- elsif cases["property"] == "add" -%>
1515
results = []
1616
<%- cases["input"]["students"].each do |student| -%>

exercises/practice/grade-school/grade_school_test.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class GradeSchoolTest < Minitest::Test
55
def test_roster_is_empty_when_no_student_is_added
66
# skip
77
school = School.new
8-
assert_empty [], school.roster
8+
assert_empty school.roster
99
end
1010

1111
def test_add_a_student
@@ -20,7 +20,7 @@ def test_student_is_added_to_the_roster
2020
skip
2121
school = School.new
2222
school.add('Aimee', 2)
23-
assert_empty ["Aimee"], school.roster
23+
assert_equal ["Aimee"], school.roster
2424
end
2525

2626
def test_adding_multiple_students_in_the_same_grade_in_the_roster
@@ -39,7 +39,7 @@ def test_multiple_students_in_the_same_grade_are_added_to_the_roster
3939
school.add('Blair', 2)
4040
school.add('James', 2)
4141
school.add('Paul', 2)
42-
assert_empty %w[Blair James Paul], school.roster
42+
assert_equal %w[Blair James Paul], school.roster
4343
end
4444

4545
def test_cannot_add_student_to_same_grade_in_the_roster_more_than_once
@@ -60,7 +60,7 @@ def test_student_not_added_to_same_grade_in_the_roster_more_than_once
6060
school.add('James', 2)
6161
school.add('James', 2)
6262
school.add('Paul', 2)
63-
assert_empty %w[Blair James Paul], school.roster
63+
assert_equal %w[Blair James Paul], school.roster
6464
end
6565

6666
def test_adding_students_in_multiple_grades
@@ -77,7 +77,7 @@ def test_students_in_multiple_grades_are_added_to_the_roster
7777
school = School.new
7878
school.add('Chelsea', 3)
7979
school.add('Logan', 7)
80-
assert_empty %w[Chelsea Logan], school.roster
80+
assert_equal %w[Chelsea Logan], school.roster
8181
end
8282

8383
def test_cannot_add_same_student_to_multiple_grades_in_the_roster
@@ -98,7 +98,7 @@ def test_student_not_added_to_multiple_grades_in_the_roster
9898
school.add('James', 2)
9999
school.add('James', 3)
100100
school.add('Paul', 3)
101-
assert_empty %w[Blair James Paul], school.roster
101+
assert_equal %w[Blair James Paul], school.roster
102102
end
103103

104104
def test_students_are_sorted_by_grades_in_the_roster
@@ -107,7 +107,7 @@ def test_students_are_sorted_by_grades_in_the_roster
107107
school.add('Jim', 3)
108108
school.add('Peter', 2)
109109
school.add('Anna', 1)
110-
assert_empty %w[Anna Peter Jim], school.roster
110+
assert_equal %w[Anna Peter Jim], school.roster
111111
end
112112

113113
def test_students_are_sorted_by_name_in_the_roster
@@ -116,7 +116,7 @@ def test_students_are_sorted_by_name_in_the_roster
116116
school.add('Peter', 2)
117117
school.add('Zoe', 2)
118118
school.add('Alex', 2)
119-
assert_empty %w[Alex Peter Zoe], school.roster
119+
assert_equal %w[Alex Peter Zoe], school.roster
120120
end
121121

122122
def test_students_are_sorted_by_grades_and_then_by_name_in_the_roster
@@ -129,7 +129,7 @@ def test_students_are_sorted_by_grades_and_then_by_name_in_the_roster
129129
school.add('Alex', 2)
130130
school.add('Jim', 3)
131131
school.add('Charlie', 1)
132-
assert_empty %w[Anna Barb Charlie Alex Peter Zoe Jim], school.roster
132+
assert_equal %w[Anna Barb Charlie Alex Peter Zoe Jim], school.roster
133133
end
134134

135135
def test_grade_is_empty_if_no_students_in_the_roster

0 commit comments

Comments
 (0)