From 6fb8e3c3afa90ca1cab69fbf2abed3722d7b173c Mon Sep 17 00:00:00 2001 From: Srdjan Pejic Date: Thu, 23 Sep 2010 21:06:40 -0400 Subject: [PATCH] Cool test; Still can't believe there is no standard implementation of first/rest --- src/about_array_assignment.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/about_array_assignment.rb b/src/about_array_assignment.rb index 659ce6b..035d5bb 100644 --- a/src/about_array_assignment.rb +++ b/src/about_array_assignment.rb @@ -12,6 +12,12 @@ class AboutArrayAssignment < EdgeCase::Koan assert_equal __("Smith"), last_name end + def test_parallel_assigments_with_splat_operator + first_name, *last_name = ["John", "Smith", "III"] + assert_equal "John", first_name + assert_equal ["Smith","III"], last_name + end + def test_parallel_assignments_with_extra_values first_name, last_name = ["John", "Smith", "III"] assert_equal __("John"), first_name