Sha256: 41eddabda9b829abc146cb4bd5b940322e50a7b6ed9d780b987d17362c62c46c

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

# encoding: utf-8
require File.join(File.dirname(__FILE__), 'helper')

class InflectorTest < Test::Unit::TestCase #:nodoc: all
  def test_titleize
    assert_equal 'Sugar Grove', Geokit::Inflector.titleize('Sugar Grove')
    assert_equal 'Sugar Grove', Geokit::Inflector.titleize('Sugar grove')
    assert_equal 'Sugar Grove', Geokit::Inflector.titleize('sugar Grove')
    assert_equal 'Sugar Grove', Geokit::Inflector.titleize('sugar grove')
  end

  def test_titleize_with_unicode
    assert_equal 'Borås', Geokit::Inflector.titleize('Borås')
    assert_equal 'Borås', Geokit::Inflector.titleize('borås')
    assert_equal 'Borås (Abc)', Geokit::Inflector.titleize('Borås (Abc)')
    assert_equal 'Borås (Abc)', Geokit::Inflector.titleize('Borås (abc)')
    assert_equal 'Borås (Abc)', Geokit::Inflector.titleize('borås (Abc)')
    assert_equal 'Borås (Abc)', Geokit::Inflector.titleize('borås (abc)')
  end

  def test_url_escape
    assert_equal '%E4%B8%8A%E6%B5%B7%E5%B8%82%E5%BE%90%E6%B1%87%E5%8C%BA%E6%BC%95%E6%BA%AA%E5%8C%97%E8%B7%AF1111%E5%8F%B7', Geokit::Inflector.url_escape('上海市徐汇区漕溪北路1111号')
    assert_equal '%C3%BC%C3%B6%C3%A4', Geokit::Inflector.url_escape('üöä')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geokit-1.9.0 test/test_inflector.rb