Sha256: 5e76d7834aef7d6ac430ef4d9da74c8a34b33716208d5e6f83a6d8bdb0f6f203
Contents?: true
Size: 836 Bytes
Versions: 8
Compression:
Stored size: 836 Bytes
Contents
require 'spec_helper' describe FuzzyMatch::Rule::Identity do it %{determines whether two records COULD be identical} do i = FuzzyMatch::Rule::Identity.new %r{(A)[ ]*(\d)} i.identical?(r('A1'), r('A 1foobar')).should == true end it %{determines that two records MUST NOT be identical} do i = FuzzyMatch::Rule::Identity.new %r{(A)[ ]*(\d)} i.identical?(r('A1'), r('A 2foobar')).should == false end it %{returns nil indicating no information} do i = FuzzyMatch::Rule::Identity.new %r{(A)[ ]*(\d)} i.identical?(r('B1'), r('A 2foobar')).should == nil end it %{embraces case insensitivity} do i = FuzzyMatch::Rule::Identity.new %r{(A)[ ]*(\d)}i i.identical?(r('A1'), r('a 1foobar')).should == true end private def r(str) FuzzyMatch::Record.new str end end
Version data entries
8 entries across 8 versions & 2 rubygems