2019-10-08 20:06:06 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe Checksummable do
|
2019-10-08 20:06:06 -04:00
|
|
|
describe ".hexdigest" do
|
|
|
|
let(:fake_class) do
|
|
|
|
Class.new do
|
|
|
|
include Checksummable
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns the SHA256 sum of the file' do
|
|
|
|
expected = Digest::SHA256.file(__FILE__).hexdigest
|
|
|
|
|
|
|
|
expect(fake_class.hexdigest(__FILE__)).to eq(expected)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|