Sha256: 8793476b92382fefc8e8694ea88c0e0996f6f465321595a53a84394d470e6f78

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

require 'helper'

class TestBlocking < Test::Unit::TestCase
  def test_001_match_one
    b = FuzzyMatch::Blocking.new %r{apple}
    assert_equal true, b.match?('2 apples')
  end
  
  def test_002_join_both
    b = FuzzyMatch::Blocking.new %r{apple}
    assert_equal true, b.join?('apple', '2 apples')    
  end
  
  def test_002_doesnt_join_both
    b = FuzzyMatch::Blocking.new %r{apple}
    assert_equal false, b.join?('orange', '2 apples')
  end
  
  def test_003_no_information
    b = FuzzyMatch::Blocking.new %r{apple}
    assert_equal nil, b.join?('orange', 'orange')
  end
  
  def test_004_accepts_case_insensitivity
    b = FuzzyMatch::Blocking.new %r{apple}i
    assert_equal true, b.match?('2 Apples')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fuzzy_match-1.2.2 test/test_blocking.rb
fuzzy_match-1.2.1 test/test_blocking.rb