Sha256: c6f63e1619f48f39be21b987dcdfff33d3eab5d85225f1c8165173a4cfbe6b47

Contents?: true

Size: 509 Bytes

Versions: 3

Compression:

Stored size: 509 Bytes

Contents

require 'test/unit'
require "Hunspell"

class HunspellTest < Test::Unit::TestCase
  def setup
    @sp = Hunspell.new("test/dict/hu_HU.aff", "test/dict/hu_HU.dic") 
  end

  def test_spellcheck
    assert @sp.spellcheck('ablak')
  end

  def test_false_spellcheck
    assert !@sp.spellcheck("paprica")
  end

  def test_suggestions
    assert !@sp.spellcheck('paprica')

    suggestions = @sp.suggest("paprica")
    assert !suggestions.include?('paprica')
    assert suggestions.include?('paprika')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hunspell-0.1.6 test/test_hunspell.rb
hunspell-0.1.5 test/test_hunspell.rb
hunspell-0.1.4 test/test_hunspell.rb