Sha256: c4842cfecdce72bd7a26428d1c4a7c18a21d5a0439a095eb466afc5e7df6b3f1

Contents?: true

Size: 831 Bytes

Versions: 1

Compression:

Stored size: 831 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/string/last.rb
#
# Extracted Tue Jun 06 09:30:19 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/core/string/last.rb'


  require 'test/unit'

  class TCString < Test::Unit::TestCase

    def test_last
      assert_equal( "z", "abcxyz".last )
      assert_equal( "cz", "ax by cz".last(' ') )
      assert_equal( "c", "a\nb\nc".last("\n") )
    end

    def test_last_eq
      s = "abc"
      s.last = "123"
      assert_equal( "abc123", s )
      s = "a\nbc"
      s.last = "123"
      assert_equal( "a\nbc123", s )
    end

    def test_last!
      s = "abc"
      s.last!
      assert_equal( "ab", s )
      s = "a b c"
      s.last!(' ')
      assert_equal( "a b", s )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.4.1 test/lib/facets/core/string/test_last.rb