Sha256: 1309818d9fcd518505b6914707b0d4945943514b543f79553522fe67ca9444bf

Contents?: true

Size: 860 Bytes

Versions: 2

Compression:

Stored size: 860 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 'PfY7essFItpoXa1f6EuB/deyUmQ='
  end

  it 'should work on all strings' do
    'abc'.checksum.must_equal 'NkkYRO+25f6psNSeCYykXKCg3C0='
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-3.8.0 test/base/core_ext/string_spec.rb
nanoc-3.7.5 test/base/core_ext/string_spec.rb