Sha256: b79dae1f5436a75992075260da46078c2dc852059dec89bd67fe7fcc4351ff37

Contents?: true

Size: 864 Bytes

Versions: 7

Compression:

Stored size: 864 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

7 entries across 7 versions & 1 rubygems

Version Path
nanoc-3.7.4 test/base/core_ext/string_spec.rb
nanoc-3.7.3 test/base/core_ext/string_spec.rb
nanoc-3.7.2 test/base/core_ext/string_spec.rb
nanoc-3.7.1 test/base/core_ext/string_spec.rb
nanoc-3.7.0 test/base/core_ext/string_spec.rb
nanoc-3.6.11 test/base/core_ext/string_spec.rb
nanoc-3.6.10 test/base/core_ext/string_spec.rb