Sha256: b8d9592cfdda4d63e89a17abb31f422d68f8bc7e7845f21ae8fcb97a37e90da2

Contents?: true

Size: 775 Bytes

Versions: 11

Compression:

Stored size: 775 Bytes

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require "fat_free_crm/core_ext/string"

describe "String" do
  it "should generate all possible combinations of first and last name from a query" do
    expected = [
      ["Stephanie", "Man Chi Lo"],
      ["Stephanie Man", "Chi Lo"],
      ["Stephanie Man Chi", "Lo"],
      ["Lo", "Stephanie Man Chi"],
      ["Chi Lo", "Stephanie Man"],
      ["Man Chi Lo", "Stephanie"]
    ]
    result = "Stephanie Man Chi Lo".name_permutations
    result.sort.should == expected.sort
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.13.5 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.13.4 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.13.3 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.13.2 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.12.3 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.12.2 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.13.1 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.12.1 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.13.0 spec/lib/core_ext/string_spec.rb
fat_free_crm-0.12.0 spec/lib/core_ext/string_spec.rb