Sha256: 3f6f7357730702c5b4e12e7478a3fbcad81860d3620ce2d4d34aaed209418637

Contents?: true

Size: 464 Bytes

Versions: 3

Compression:

Stored size: 464 Bytes

Contents

require 'spec_helper'
module Alf
  describe "Tools#varargs" do
    
    specify "with exact args" do
      Tools.varargs([1, "hello"], [Integer, String]).should eq([1, "hello"])
    end
    
    specify "with missing args" do
      Tools.varargs(["hello"], [Integer, String]).should eq([nil, "hello"])
      Tools.varargs([], [Integer, String]).should eq([nil, nil])
      Tools.varargs([1, 2], [Integer, String, Integer]).should eq([1, nil, 2])
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alf-0.10.1 spec/unit/tools/test_varargs.rb
alf-0.10.0 spec/unit/tools/test_varargs.rb
alf-0.9.3 spec/unit/tools/test_varargs.rb