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

Version Path
rake-delphi-0.0.31 test/test-string.rb
rake-delphi-0.0.29 test/test-string.rb
rake-delphi-0.0.30 test/test-string.rb
rake-delphi-0.0.28 test/test-string.rb
rake-delphi-0.0.27 test/test-string.rb
rake-delphi-0.0.26 test/test-string.rb
rake-delphi-0.0.25 test/test-string.rb
rake-delphi-0.0.24 test/test-string.rb
rake-delphi-0.0.23 test/test-string.rb
rake-delphi-0.0.22 test/test-string.rb
rake-delphi-0.0.21 test/test-string.rb
rake-delphi-0.0.20 test/test-string.rb
rake-delphi-0.0.19 test/test-string.rb
rake-delphi-0.0.18 test/test-string.rb
rake-delphi-0.0.17 test/test-string.rb
rake-delphi-0.0.16 test/test-string.rb
rake-delphi-0.0.15 test/test-string.rb
rake-delphi-0.0.14 test/test-string.rb
rake-delphi-0.0.13 test/test-string.rb
rake-delphi-0.0.12 test/test-string.rb