Sha256: f543eaf0fe92f17a31f6f159a44c0df3370d7fc2a33413db51d761993e6cd1a1
Contents?: true
Size: 627 Bytes
Versions: 2
Compression:
Stored size: 627 Bytes
Contents
require 'test/unit' require 'stemmify' class StemmifyTest < Test::Unit::TestCase def read_as_array(filename) file = File.open(filename) lines = [] file.each { |line| lines << line.chomp } return lines end def test_stem # assuming we will run the test from the root directory of the project # using "rake test" from the command-line input_words = read_as_array("test/input.txt") output_words = read_as_array("test/output.txt") for i in 0 ... input_words.length() assert_equal(output_words[i], input_words[i].stem, "input: " + input_words[i]) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stemmify-0.0.2 | test/test_stemmify.rb |
stemmify-0.0.1 | test/test_stemmify.rb |