Sha256: 3593a677cf9cde47713a48625db605c809799737256bb740c430e727e90a18e9

Contents?: true

Size: 434 Bytes

Versions: 7

Compression:

Stored size: 434 Bytes

Contents

require File.join(File.dirname(__FILE__), 'preamble')
require "text/double_metaphone"

require 'csv'

class DoubleMetaphoneTest < Test::Unit::TestCase

  def test_cases
    CSV.open(File.rel('data', 'double_metaphone.csv'), 'r').to_a.each do |row|
      primary, secondary = Text::Metaphone.double_metaphone(row[0])

      assert_equal row[1], primary
      assert_equal row[2], secondary.nil?? primary : secondary
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
text-1.2.0 test/test_double_metaphone.rb
text-1.0.4 test/test_double_metaphone.rb
text-1.0.3 test/test_double_metaphone.rb
text-1.0.2 test/test_double_metaphone.rb
text-1.0.1 test/test_double_metaphone.rb
text-1.0.0 test/test_double_metaphone.rb
text-0.2.0 test/test_double_metaphone.rb