Sha256: 45858b816cee9819d5dc23e04297153d69db3daeef8a8213e621840611c7d448
Contents?: true
Size: 1.05 KB
Versions: 21
Compression:
Stored size: 1.05 KB
Contents
# encoding: utf-8 require 'rake' require 'test/unit' require 'rake/helpers/unittest' require 'rake/helpers/string' class TestString < Test::Unit::TestCase def test_prepend assert_equal('prefix_a', 'a'.prepend('prefix_')) end def test_starts_with assert 'android32'.starts_with?('android') assert 'android'.starts_with?('android') assert ! 'win'.starts_with?('android') end def test_double_delimilters s = 'a\\b\\c' assert_equal 'a\\\\b\\\\c', 'a\\b\\c'.double_delimiters # test s was not changed assert_equal 'a\\b\\c', s assert_equal 'a/b/c', 'a/b/c'.double_delimiters assert_equal 'a/b\\\\c', 'a/b\\c'.double_delimiters end def test_double_delimilters! s = 'a\\b\\c' s.double_delimiters! assert_equal 'a\\\\b\\\\c', s s = 'a/b/c' s.double_delimiters! assert_equal 'a/b/c', s s = 'a/b\\c' s.double_delimiters! assert_equal 'a/b\\\\c', s end end
Version data entries
21 entries across 21 versions & 1 rubygems