PageRenderTime 22ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/IronPython_Main/Languages/Ruby/Tests/Interop/net/bcl/array/conversion_spec.rb

#
Ruby | 19 lines | 15 code | 4 blank | 0 comment | 3 complexity | 595b41498f05d6b2f99f258d6cb26130 MD5 | raw file
 1require File.dirname(__FILE__) + '/../../spec_helper'
 2
 3describe "Converting Ruby arrays to .NET arrays" do
 4  before :each do
 5    @method = Klass.new.method(:array_accepting_method)
 6  end
 7
 8  it "defaults to conversion to an object array" do
 9    @method.of(Object).call([1, "string"].to_clr_array).should == [1, "string"]
10  end
11
12  it "properly converts to object array" do
13    @method.of(Object).call([1, "string"].to_clr_array(Object)).should == [1, "string"]
14  end
15
16  it "properly converts to typed array" do
17    @method.of(Fixnum).call([1,2,3].to_clr_array(Fixnum)).should == [1,2,3]
18  end
19end