Sha256: a8e5cf8550a034c92f99db81a613d76dec18fa1bbb85e0da2eeff339bc523924

Contents?: true

Size: 1 KB

Versions: 19

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe Arachni::Support::LookUp::Moolb do
    it_behaves_like 'lookup'

    describe '#initialize' do
        describe :strategy do
            it 'sets the strategy for the internal cache' do
                options = {
                    strategy: Arachni::Support::Cache::LeastRecentlyUsed,
                    max_size: 3
                }

                lu = described_class.new( options )

                4.times do |i|
                    lu << i
                end

                lu.include?( 0 ).should be_false

                1.upto( 3 ) do |i|
                    lu.include?( i ).should be_true
                end
            end
        end
        describe :max_size do
            it 'sets the maximum size of the cache' do
                options = { max_size: 3 }

                lu = described_class.new( options )

                40.times do |i|
                    lu << i
                end

                lu.size.should == 3
            end
        end
    end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
arachni-1.2.1 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.2 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.1 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.0.6 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.0.5 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.0.4 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.0.3 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.0.2 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.0.1 spec/arachni/support/lookup/moolb_spec.rb
arachni-1.0 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.7 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.6 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.5.2 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.5.1 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.5 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.4 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.3.2 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.3.1 spec/arachni/support/lookup/moolb_spec.rb
arachni-0.4.3 spec/arachni/support/lookup/moolb_spec.rb