Sha256: 01bfacd356f018bb960224ea8bdce0d9cc8692005a95261ef35fbb0c424d6be8

Contents?: true

Size: 998 Bytes

Versions: 2

Compression:

Stored size: 998 Bytes

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

require 'spec_helper'

include TwitterCldr::Shared

describe Casefolder do
  describe "#casefold" do
    it "should casefold a few canonical examples" do
      Casefolder.casefold("Weißrussland").should == "weissrussland"
      Casefolder.casefold("Hello, World").should == "hello, world"
    end

    it "should correctly casefold the Turkic i character" do
      Casefolder.casefold("Istanbul", true).should == "ıstanbul"
      Casefolder.casefold("İstanbul", true).should == "istanbul"
    end

    # the files used in this test come from the unicode_utils gem
    it "should casefold a large block of text and exactly match the expected text" do
      base_path = File.dirname(__FILE__)
      text = File.read(File.join(base_path, "casefolding.txt"))
      expected = File.read(File.join(base_path, "casefolding_expected.txt"))
      Casefolder.casefold(text).should == expected
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter_cldr-3.0.1 spec/shared/casefolder_spec.rb
twitter_cldr-3.0.0 spec/shared/casefolder_spec.rb