Sha256: f09c341e0e0a476e619f0e5052da56c0b1c58ddb74bab544ba373cd54e00211b

Contents?: true

Size: 667 Bytes

Versions: 8

Compression:

Stored size: 667 Bytes

Contents

require 'spec_helper'

describe FuzzyMatch::Record do
  it %{does not treat "'s" as a word} do
    assert_split ["foo's", "bar"], "Foo's Bar"
  end
  
  it %{treats "bolivia," as just "bolivia"} do
    assert_split ["bolivia", "plurinational", "state"], "Bolivia, Plurinational State"
  end
  
  it %{does not split up hyphenated words} do
    assert_split ['north-west'], "north-west"
  end
  
  it %{splits up words as expected} do
    assert_split ['the', 'quick', "fox's", 'mouth', 'is', 'always', 'full'], "the quick fox's mouth -- is always full."
  end
  
  private
  
  def assert_split(ary, str)
    FuzzyMatch::Record.new(str).words.should == ary
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/fuzzy_match-2.0.4/spec/record_spec.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/fuzzy_match-2.0.4/spec/record_spec.rb
fuzzy_match-2.1.0 spec/record_spec.rb
fuzzy_match-2.0.4 spec/record_spec.rb
fuzzy_match-2.0.3 spec/record_spec.rb
fuzzy_match-2.0.2 spec/record_spec.rb
fuzzy_match-2.0.1 spec/record_spec.rb
fuzzy_match-2.0.0 spec/record_spec.rb