Skip to content

Commit

Permalink
Merge pull request exercism#733 from henrik/ruby-school-test
Browse files Browse the repository at this point in the history
ruby/grade-school: test for key order
  • Loading branch information
kytrinyx committed Sep 8, 2013
2 parents ad0dfe4 + 09f5f3c commit 2738aad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assignments/ruby/grade-school/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def grade(level)
end

def sort
sorted = db.map { |grade, students| [ grade, students.sort ] }
sorted = db.map { |grade, students| [ grade, students.sort ] }.sort
Hash[sorted]
end
end
1 change: 1 addition & 0 deletions assignments/ruby/grade-school/grade-school_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ def test_sort_school
6 => ["Kareem"]
}
assert_equal sorted, school.sort
assert_equal [3, 4, 6], school.sort.keys
end
end

0 comments on commit 2738aad

Please sign in to comment.