Sha256: bf4b851783624110450a819c522ee6cd13a3b3eeab949b9631831939c02ebca2

Contents?: true

Size: 495 Bytes

Versions: 4

Compression:

Stored size: 495 Bytes

Contents

require 'spec_helper'

module Rambling
  module Trie
    describe PlainTextReader do
      describe '#each_word' do
        let(:filepath) { File.join(::SPEC_ROOT, 'assets', 'test_words.txt') }
        let(:words) { File.readlines(filepath).map &:chomp }

        it 'yields every word yielded by the file' do
          yielded_words = []
          subject.each_word(filepath) { |word| yielded_words << word }
          expect(yielded_words).to eq(words)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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