Skip to content

Commit

Permalink
Merge pull request #460 from atambo/master
Browse files Browse the repository at this point in the history
add multiple assignment support to java.util.Collection's Fixes #459
  • Loading branch information
headius committed Mar 22, 2013
2 parents e6fcf42 + 80954e9 commit ff74833
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/java_integration/interfaces/collection_spec.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions src/jruby/java/java_ext/java.util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def to_a
# first
toArray.to_a
end
alias_method :to_ary, :to_a
end

module java::util::Enumeration
Expand Down

0 comments on commit ff74833

Please sign in to comment.