Sha256: 60f1224a8ee10afd971fc5c61064c522a56bf523d9df7d316e79e1ee1f2db7b5

Contents?: true

Size: 580 Bytes

Versions: 14

Compression:

Stored size: 580 Bytes

Contents

# encoding: utf-8

require_relative 'test_helper'

class StringExtTest < Test::Unit::TestCase
  def test_html_decode
    assert_equal("a", "a".unhtml)
    assert_equal("รค", "&auml;".unhtml)
  end

  def test_sortkey
    assert_equal("actual", "actual".sortkey)
    assert_equal("schreck003012", "der schreck 3/12".sortkey)
  end

  def test_starts_ends_with
    s = "foo bar baz"
    assert s.starts_with?("foo")
    assert !s.starts_with?("baz")
    assert !s.ends_with?("foo")
    assert s.ends_with?("baz")

    assert s.starts_with?("")
    assert s.ends_with?("")
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
radiospieler-2014.11.28 test/string_ext_test.rb
radiospieler-2013.04.01 test/string_ext_test.rb
radiospieler-2012.09.13 test/string_ext_test.rb
radiospieler-0.3.12 test/string_ext_test.rb
radiospieler-0.3.11 test/string_ext_test.rb
radiospieler-0.3.10 test/string_ext_test.rb
radiospieler-0.3.8 test/string_ext_test.rb
radiospieler-0.3.7 test/string_ext_test.rb
radiospieler-0.3.6 test/string_ext_test.rb
radiospieler-0.3.5 test/string_ext_test.rb
radiospieler-0.3.4 test/string_ext_test.rb
radiospieler-0.3.3 test/string_ext_test.rb
radiospieler-0.3.2 test/string_ext_test.rb
radiospieler-0.3.1 test/string_ext_test.rb