PageRenderTime 56ms CodeModel.GetById 23ms RepoModel.GetById 0ms 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
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
  1. require File.dirname(__FILE__) + '/../../spec_helper'
  2. describe "Converting Ruby arrays to .NET arrays" do
  3. before :each do
  4. @method = Klass.new.method(:array_accepting_method)
  5. end
  6. it "defaults to conversion to an object array" do
  7. @method.of(Object).call([1, "string"].to_clr_array).should == [1, "string"]
  8. end
  9. it "properly converts to object array" do
  10. @method.of(Object).call([1, "string"].to_clr_array(Object)).should == [1, "string"]
  11. end
  12. it "properly converts to typed array" do
  13. @method.of(Fixnum).call([1,2,3].to_clr_array(Fixnum)).should == [1,2,3]
  14. end
  15. end