Sha256: 185d5417930a20fbc30be07d6579628159c5299902d05e0c4493c8c4850f7260

Contents?: true

Size: 506 Bytes

Versions: 2

Compression:

Stored size: 506 Bytes

Contents

require 'wordlist/flat_file'

require 'spec_helper'

describe FlatFile do
  before(:all) do
    @path = File.join(File.dirname(__FILE__),'text','flat_file.txt')
    @list = FlatFile.new(@path)
  end

  it "should have a path it reads from" do
    @list.path.should == @path
  end

  it "should read the lines of the flat-file" do
    words = ['one', 'two', 'three']

    @list.each_word do |word|
      words.include?(word).should == true
      words.delete(word)
    end

    words.should == []
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wordlist-0.1.1 spec/flat_file_spec.rb
wordlist-0.1.0 spec/flat_file_spec.rb