Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add spec for array coercion #1708

Merged
merged 1 commit into from May 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions spec/java_integration/types/array_spec.rb
Expand Up @@ -928,4 +928,10 @@ def blah()
it "descends from java.lang.Object" do
ArrayJavaProxy.superclass.should == java.lang.Object
end

it "to_a coerces nested Java arrays to Ruby arrays" do
rar = [[1],[2]].to_java(Java::byte[]).to_a
rar.first.should == [1]
rar.first.first.should be_kind_of(Fixnum)
end
end