test/test_blocking.rb in fuzzy_match-1.2.2 vs test/test_blocking.rb in fuzzy_match-1.3.0
- old
+ new
@@ -1,28 +1,28 @@
require 'helper'
-class TestBlocking < Test::Unit::TestCase
- def test_001_match_one
+class TestBlocking < MiniTest::Spec
+ it %{matches a single string argument} do
b = FuzzyMatch::Blocking.new %r{apple}
- assert_equal true, b.match?('2 apples')
+ b.match?('2 apples').must_equal true
end
-
- def test_002_join_both
- b = FuzzyMatch::Blocking.new %r{apple}
- assert_equal true, b.join?('apple', '2 apples')
+
+ it %{embraces case insensitivity} do
+ b = FuzzyMatch::Blocking.new %r{apple}i
+ b.match?('2 Apples').must_equal true
end
- def test_002_doesnt_join_both
+ it %{joins two string arguments} do
b = FuzzyMatch::Blocking.new %r{apple}
- assert_equal false, b.join?('orange', '2 apples')
+ b.join?('apple', '2 apples').must_equal true
end
- def test_003_no_information
+ it %{fails to join two string arguments} do
b = FuzzyMatch::Blocking.new %r{apple}
- assert_equal nil, b.join?('orange', 'orange')
+ b.join?('orange', '2 apples').must_equal false
end
- def test_004_accepts_case_insensitivity
- b = FuzzyMatch::Blocking.new %r{apple}i
- assert_equal true, b.match?('2 Apples')
+ it %{returns nil instead of false when it has no information} do
+ b = FuzzyMatch::Blocking.new %r{apple}
+ b.join?('orange', 'orange').must_be_nil
end
end