Sha256: 782cf11a9c09c84e21318770e202bafd34b59738bcfb672b5c4c97c66f72bb1a

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 Bytes

Contents

shared_examples_for 'a serializable trie' do
  context 'and the trie is not compressed' do
    before do
      Rambling::Trie.dump trie_to_serialize, trie_filepath, serializer
    end

    it_behaves_like 'a compressable trie' do
      let(:trie) { loaded_trie }
    end
  end

  context 'and the trie is compressed' do
    let(:trie) { loaded_trie }

    before do
      FileUtils.rm_f trie_filepath
      Rambling::Trie.dump trie_to_serialize.compress!, trie_filepath, serializer
    end

    it_behaves_like 'a trie data structure'

    it 'is marked as compressed' do
      expect(trie).to be_compressed
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rambling-trie-1.0.2 spec/support/shared_examples/a_serializable_trie.rb
rambling-trie-1.0.1 spec/support/shared_examples/a_serializable_trie.rb
rambling-trie-1.0.0 spec/support/shared_examples/a_serializable_trie.rb