git://git.eng.unimelb.edu.au
/
ruby_koans.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1dcd9ba
)
Cool test; Still can't believe there is no standard implementation of first/rest
author
Srdjan Pejic
<srdjan@themarknews.com>
Fri, 24 Sep 2010 01:06:40 +0000
(21:06 -0400)
committer
Jim Weirich
<jim.weirich@gmail.com>
Tue, 28 Sep 2010 18:11:08 +0000
(14:11 -0400)
src/about_array_assignment.rb
patch
|
blob
|
history
diff --git
a/src/about_array_assignment.rb
b/src/about_array_assignment.rb
index
659ce6b
..
035d5bb
100644
(file)
--- 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