spec/phonetic/double_metaphone_spec.rb in phonetic-1.1.0 vs spec/phonetic/double_metaphone_spec.rb in phonetic-1.2.0
- old
+ new
@@ -2,11 +2,12 @@
require 'support/double_metaphone_data'
describe Phonetic::DoubleMetaphone do
describe '.encode' do
it 'should return Double Metaphone codes of string' do
- Phonetic::DOUBLE_METAPHONE_TEST_TABLE.each do |w, r|
- Phonetic::DoubleMetaphone.encode(w).should == r
+ Phonetic::DOUBLE_METAPHONE_TEST_TABLE.each do |w, code|
+ res = Phonetic::DoubleMetaphone.encode(w)
+ res.should eq(code), "expected: #{code}\ngot: #{res}\nword: #{w}"
end
end
it 'should support max size of the code option' do
Phonetic::DoubleMetaphone.encode('accede', size: 3).should == ['AKS', 'AKS']