Sha256: a5d88f00496a8a484980e0f598fb8a5e7bc783fd07a4fd61bf09ecc84a31ea1f

Contents?: true

Size: 572 Bytes

Versions: 16

Compression:

Stored size: 572 Bytes

Contents

Facter.add(:foo, :type => :aggregate) do
    chunk(:one) do
        1
    end

    chunk(:two) do
        2
    end

    chunk(:three) do
        3
    end

    chunk(:four) do
        4
    end

    aggregate do |chunks|
        raise 'nope' unless chunks.size == 4
        raise 'nope' unless chunks.has_key? :one
        raise 'nope' unless chunks.has_key? :two
        raise 'nope' unless chunks.has_key? :three
        raise 'nope' unless chunks.has_key? :four
        sum = 0
        chunks.each_value do |i|
            sum += i
        end
        sum
    end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.12.1.cfacter.20181031 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.11.6.cfacter.20181031 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.12.1.cfacter.20181023 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.11.5.cfacter.20181022 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.12.0.cfacter.20181004 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.12.0.cfacter.20181001 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.12.0.cfacter.20180918 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.11.4.cfacter.20180821 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.11.3.cfacter.20180716 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.11.2.cfacter.20180612 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.9.6.cfacter.20180612 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.11.2.cfacter.20180606 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.9.6.cfacter.20180606 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
facter-3.11.0.cfacter.20180319 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb
cfacter-3.11.0.rc.20180314 ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb