Sha256: f47e4c0b3917ce0a63858c56669a6ed0c842ff95905e0f110473595eb25204db

Contents?: true

Size: 449 Bytes

Versions: 8

Compression:

Stored size: 449 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

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

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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rambling-trie-2.3.0 spec/lib/rambling/trie/readers/plain_text_spec.rb
rambling-trie-2.2.1 spec/lib/rambling/trie/readers/plain_text_spec.rb
rambling-trie-2.2.0 spec/lib/rambling/trie/readers/plain_text_spec.rb
rambling-trie-opal-2.1.1.1 spec/lib/rambling/trie/readers/plain_text_spec.rb
rambling-trie-opal-2.1.1 spec/lib/rambling/trie/readers/plain_text_spec.rb
rambling-trie-2.1.1 spec/lib/rambling/trie/readers/plain_text_spec.rb
rambling-trie-2.1.0 spec/lib/rambling/trie/readers/plain_text_spec.rb
rambling-trie-2.0.0 spec/lib/rambling/trie/readers/plain_text_spec.rb