Sha256: e09db25f6df0719af72db3263aa46a3199f1772e08b94eefee2731091f36a8f3

Contents?: true

Size: 681 Bytes

Versions: 20

Compression:

Stored size: 681 Bytes

Contents

# encoding: utf-8

describe 'Pathname#checksum' do

  it 'should work on empty files' do
    begin
      FileUtils.mkdir_p('tmp')
      File.open('tmp/myfile', 'w') { |io| io.write('') }
      pathname = Pathname.new('tmp/myfile')
      pathname.checksum.must_equal 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
    ensure
      FileUtils.rm_rf('tmp')
    end
  end

  it 'should work on all files' do
    begin
      FileUtils.mkdir_p('tmp')
      File.open('tmp/myfile', 'w') { |io| io.write('abc') }
      pathname = Pathname.new('tmp/myfile')
      pathname.checksum.must_equal 'a9993e364706816aba3e25717850c26c9cd0d89d'
    ensure
      FileUtils.rm_rf('tmp')
    end
  end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
nanoc-3.4.3 test/base/core_ext/pathname_spec.rb
nanoc-3.4.2 test/base/core_ext/pathname_spec.rb
nanoc-3.4.1 test/base/core_ext/pathname_spec.rb
nanoc-3.4.0 test/base/core_ext/pathname_spec.rb
nanoc-3.3.7 test/base/core_ext/pathname_spec.rb
nanoc-3.3.6 test/base/core_ext/pathname_spec.rb
nanoc-3.3.5 test/base/core_ext/pathname_spec.rb
nanoc-3.3.4 test/base/core_ext/pathname_spec.rb
nanoc-3.3.3 test/base/core_ext/pathname_spec.rb
nanoc-3.3.2 test/base/core_ext/pathname_spec.rb
nanoc-3.3.1 test/base/core_ext/pathname_spec.rb
nanoc-3.3.0 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.4 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.3 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.2 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.1 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.0 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.0b3 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.0b2 test/base/core_ext/pathname_spec.rb
nanoc3-3.2.0b1 test/base/core_ext/pathname_spec.rb