Sha256: cf9cc12d57884a3e097f1139d100487ef849a7ca6b8795fa98452827729fff5b

Contents?: true

Size: 817 Bytes

Versions: 1

Compression:

Stored size: 817 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/nano/string/last.rb
#
# Extracted Fri Oct 28 14:20:18 EDT 2005
# Unit Tools Reap Test Extractor
#

require 'nano/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-0.9.0 test/lib/nano/string/test_last.rb