Permalink
Browse files

Merge pull request #460 from atambo/master

add multiple assignment support to java.util.Collection's Fixes #459
  • Loading branch information...
2 parents e6fcf42 + 80954e9 commit ff74833a08c04bdcc68429b7be7e7aa2c408224f @headius headius committed Mar 22, 2013
Showing with 17 additions and 0 deletions.
  1. +16 −0 spec/java_integration/interfaces/collection_spec.rb
  2. +1 −0 src/jruby/java/java_ext/java.util.rb
@@ -0,0 +1,16 @@
+require File.dirname(__FILE__) + "/../spec_helper"
+
+describe "Classes that implement Collection" do
+ before do
+ @first_item = 'first'
+ @second_item = 'second'
+ @items = [@first_item, @second_item]
+ @collection = Java::JavaUtil::ArrayList.new(@items)
+ end
+
+ it "should support multiple assignment" do
+ first_item, second_item = @collection
+ first_item.should eql @first_item
+ second_item.should eql @second_item
+ end
+end
@@ -29,6 +29,7 @@ def to_a
# first
toArray.to_a
end
+ alias_method :to_ary, :to_a
end
module java::util::Enumeration

0 comments on commit ff74833

Please sign in to comment.