test/soundex_test.rb in text-1.2.3 vs test/soundex_test.rb in text-1.3.0
- old
+ new
@@ -1,28 +1,20 @@
-require "test_helper"
+require_relative "./test_helper"
require "text/soundex"
require 'yaml'
class SoundexTest < Test::Unit::TestCase
def test_cases
- YAML.load(%{
-
- Euler: E460
- Ellery: E460
- Gauss: G200
- Ghosh: G200
- Hilbert: H416
- Heilbronn: H416
- Knuth: K530
- Kant: K530
- Lloyd: L300
- Ladd: L300
- Lukasiewicz: L222
- Lissajous: L222
-
- }).each do |input, expected_output|
+ YAML.load(data_file('soundex.yml')).each do |input, expected_output|
assert_equal expected_output, Text::Soundex.soundex(input)
end
end
+ def test_should_return_nil_for_empty_string
+ assert_nil Text::Soundex.soundex("")
+ end
+
+ def test_should_return_nil_for_string_with_no_letters
+ assert_nil Text::Soundex.soundex("!@#123")
+ end
end