debian-mirror-gitlab/spec/models/concerns/checksummable_spec.rb
2020-08-09 17:41:57 +05:30

19 lines
389 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Checksummable do
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