/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
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, CPL-1.0, CC-BY-SA-3.0, BSD-3-Clause, ISC, AGPL-3.0, LGPL-2.1, Apache-2.0
- require File.dirname(__FILE__) + '/../../spec_helper'
-
- describe "Converting Ruby arrays to .NET arrays" do
- before :each do
- @method = Klass.new.method(:array_accepting_method)
- end
-
- it "defaults to conversion to an object array" do
- @method.of(Object).call([1, "string"].to_clr_array).should == [1, "string"]
- end
-
- it "properly converts to object array" do
- @method.of(Object).call([1, "string"].to_clr_array(Object)).should == [1, "string"]
- end
-
- it "properly converts to typed array" do
- @method.of(Fixnum).call([1,2,3].to_clr_array(Fixnum)).should == [1,2,3]
- end
- end