Sha256: 0647a4f86f5f919b8bc90763a239c1e1b13ca5028db329584cbb84fe64ba251d

Contents?: true

Size: 720 Bytes

Versions: 11

Compression:

Stored size: 720 Bytes

Contents

require 'helper'

describe 'String extensions' do
  it 'should have #starts_with?' do
    '123456789'.starts_with?('12').should.equal true
    '123456789'.starts_with?('23').should.not.equal true
  end

  it 'should have #ends_with?' do
    '123456789'.ends_with?('89').should.equal true
    '123456789'.ends_with?('98').should.not.equal true
  end

  it 'should have #cleanpath' do
    '/'.cleanpath.should.equal ''
    '/a/b/c/../'.cleanpath.should.equal 'a/b'
    '/a/./b/../c/../d/./'.cleanpath.should.equal 'a/d'
    '1///2'.cleanpath.should.equal '1/2'
  end

  it 'should have #/' do
    (''/'').should.equal ''
    ('//a/b///'/'').should.equal 'a/b'
    ('a'/'x'/'..'/'b'/'c'/'.').should.equal 'a/b/c'
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
olelo-0.9.15 test/string_extensions_test.rb
olelo-0.9.14 test/string_extensions_test.rb
olelo-0.9.13 test/string_extensions_test.rb
olelo-0.9.12 test/string_extensions_test.rb
olelo-0.9.11 test/string_extensions_test.rb
olelo-0.9.10 test/string_extensions_test.rb
olelo-0.9.9 test/string_extensions_test.rb
olelo-0.9.8 test/string_extensions_test.rb
olelo-0.9.7 test/string_extensions_test.rb
olelo-0.9.6 test/string_extensions_test.rb
olelo-0.9.5 test/string_extensions_test.rb