Sha256: dad2c06cb3c86c48487ae6ebe672f20cff5901c3f1fe2eec095ae5c509cd5a8e

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

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

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


  require 'test/unit'

  class TCString < Test::Unit::TestCase

    def test_bracket
      assert_equal( '#X#', 'X'.bracket('#') )
      assert_equal( 'xX!', 'X'.bracket('x','!') )
      assert_equal( '{X}', 'X'.bracket('{','}') )
      assert_equal( '<X>', 'X'.bracket('<') )
      assert_equal( '(X)', 'X'.bracket('(') )
      assert_equal( '[X]', 'X'.bracket('[') )
      assert_equal( '{X}', 'X'.bracket('{') )
    end

    def test_braket!
      a = 'X' ; a.bracket!('#')
      assert_equal( '#X#', a )
      a = 'X' ; a.bracket!('x','!')
      assert_equal( 'xX!', a )
      a = 'X' ; a.bracket!('{','}')
      assert_equal( '{X}', a )
      a = 'X' ; a.bracket!('<')
      assert_equal( '<X>', a )
      a = 'X' ; a.bracket!('(')
      assert_equal( '(X)', a )
      a = 'X' ; a.bracket!('[')
      assert_equal( '[X]', a )
      a = 'X' ; a.bracket!('{')
      assert_equal( '{X}', a )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

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