Sha256: cbda8150eb89c758c85b28d88a12dd88afa660a228cee3d8a2a12b8cd54356e6

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

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

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