Sha256: 14e3def18d20aeb2c36e82f64bc1940e02d58ec37f7eb2aa6b233b8eeb09ac8f

Contents?: true

Size: 778 Bytes

Versions: 1

Compression:

Stored size: 778 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/string/first.rb
#
# Extracted Fri Feb 16 02:00:37 EST 2007
# Project.rb Test Extraction
#

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


  require 'test/unit'

  class TCString < Test::Unit::TestCase

    def test_first
      assert_equal( "a", "abcxyz".first )
      assert_equal( "ax", "ax by cz".first(' ') )
      assert_equal( "a", "a\nb\nc".first("\n") )
    end

    def test_first_eq
      s = "abc"
      s.first = "123"
      assert_equal( "123abc", s )
      s = "a\nbc"
      s.first = "123"
      assert_equal( "123a\nbc", s )
    end

    def test_first!
      s = "a\nbc"
      s.first!("\n")
      assert_equal( "bc", s )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.8.49 test/lib/facets/core/string/test_first.rb