Sha256: 01aa7e030f9243e28e05fbd8181f7830e4eff0b0313696314dea95b5e6ea7113

Contents?: true

Size: 374 Bytes

Versions: 2

Compression:

Stored size: 374 Bytes

Contents

require 'spec_helper'
module Alf
  describe "Tools#coalesce" do
    
    it "should support a varargs variant" do
      Tools.coalesce(:a, nil, :b, :c).should eql(:a)
      Tools.coalesce(nil, :a, nil, :b, :c).should eql(:a)
    end
    
    it "should support a block for costly computations" do
      Tools.coalesce(nil){ :hello }.should eql(:hello)
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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