Sha256: 71255e662e2dc5f5763d71264a628730595bbfa3e7923ee4187a888e7029cb0e

Contents?: true

Size: 888 Bytes

Versions: 33

Compression:

Stored size: 888 Bytes

Contents

# encoding: utf-8

describe 'String#cleaned_identifier' do

  it 'should not convert already clean paths' do
    '/foo/bar/'.cleaned_identifier.must_equal '/foo/bar/'
  end

  it 'should prepend slash if necessary' do
    'foo/bar/'.cleaned_identifier.must_equal '/foo/bar/'
  end

  it 'should append slash if necessary' do
    '/foo/bar'.cleaned_identifier.must_equal '/foo/bar/'
  end

  it 'should remove double slashes at start' do
    '//foo/bar/'.cleaned_identifier.must_equal '/foo/bar/'
  end

  it 'should remove double slashes at end' do
    '/foo/bar//'.cleaned_identifier.must_equal '/foo/bar/'
  end

end

describe 'String#checksum' do

  it 'should work on empty strings' do
    ''.checksum.must_equal 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
  end

  it 'should work on all strings' do
    'abc'.checksum.must_equal 'a9993e364706816aba3e25717850c26c9cd0d89d'
  end

end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
nanoc-3.3.4 test/base/core_ext/string_spec.rb
nanoc-3.3.3 test/base/core_ext/string_spec.rb
nanoc-3.3.2 test/base/core_ext/string_spec.rb
nanoc-3.3.1 test/base/core_ext/string_spec.rb
nanoc-3.3.0 test/base/core_ext/string_spec.rb
nanoc3-3.2.4 test/base/core_ext/string_spec.rb
nanoc3-3.2.3 test/base/core_ext/string_spec.rb
nanoc3-3.2.2 test/base/core_ext/string_spec.rb
nanoc3-3.2.1 test/base/core_ext/string_spec.rb
nanoc3-3.2.0 test/base/core_ext/string_spec.rb
nanoc3-3.2.0b3 test/base/core_ext/string_spec.rb
nanoc3-3.2.0b2 test/base/core_ext/string_spec.rb
nanoc3-3.2.0b1 test/base/core_ext/string_spec.rb