Sha256: a80e978951e6dcb964cc75a8d9b307645bf3c7a84f6724837bf1c11ff9094d3d

Contents?: true

Size: 561 Bytes

Versions: 5

Compression:

Stored size: 561 Bytes

Contents

require 'spec_helper'

module Rambling
  module Trie
    describe Inspector do
      let(:root) do
        Root.new do |trie|
          %w(only three words).each { |word| trie << word }
        end
      end

      let(:node) { root[:o] }

      describe '#inspect' do
        it 'returns a pretty printed version of the node' do
          expect(root.inspect).to eq("#<Rambling::Trie::Root letter: nil, children: [:o, :t, :w]>")
          expect(node.inspect).to eq("#<Rambling::Trie::Node letter: :o, children: [:n]>")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rambling-trie-0.6.1 spec/lib/rambling/trie/inspector_spec.rb
rambling-trie-0.6.0 spec/lib/rambling/trie/inspector_spec.rb
rambling-trie-0.5.2 spec/lib/rambling/trie/inspector_spec.rb
rambling-trie-0.5.1 spec/lib/rambling/trie/inspector_spec.rb
rambling-trie-0.5.0 spec/lib/rambling/trie/inspector_spec.rb