Sha256: 24d5ad766b33f31e13cf1578e2cbc2a863bbaebe74f150b73b06f2c367e86882

Contents?: true

Size: 747 Bytes

Versions: 40

Compression:

Stored size: 747 Bytes

Contents

require "spec_helper"

module ActiveFedora
  describe Checksum do
    subject { described_class.new(file) }

    let(:uri) { ::RDF::URI("urn:sha1:bb3200c2ddaee4bd7b9a4dc1ad3e10ed886eaef1") }

    describe "when initialized with a file having a digest" do
      let(:file) { double(digest: [uri]) }

      its(:uri) { is_expected.to eq(uri) }
      its(:value) { is_expected.to eq("bb3200c2ddaee4bd7b9a4dc1ad3e10ed886eaef1") }
      its(:algorithm) { is_expected.to eq("SHA1") }
    end

    describe "when initialized with a file not having a digest" do
      let(:file) { double(digest: []) }

      its(:uri) { is_expected.to be_nil }
      its(:value) { is_expected.to be_nil }
      its(:algorithm) { is_expected.to be_nil }
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
active-fedora-10.3.0 spec/unit/checksum_spec.rb
active-fedora-9.7.3 spec/unit/checksum_spec.rb
active-fedora-10.3.0.rc2 spec/unit/checksum_spec.rb
active-fedora-11.0.0.rc7 spec/unit/checksum_spec.rb
active-fedora-10.3.0.rc1 spec/unit/checksum_spec.rb
active-fedora-11.0.0.rc6 spec/unit/checksum_spec.rb
active-fedora-10.2.1 spec/unit/checksum_spec.rb
active-fedora-11.0.0.rc5 spec/unit/checksum_spec.rb
active-fedora-11.0.0.rc4 spec/unit/checksum_spec.rb
active-fedora-10.2.0 spec/unit/checksum_spec.rb
active-fedora-11.0.0.rc3 spec/unit/checksum_spec.rb
active-fedora-11.0.0.rc2 spec/unit/checksum_spec.rb
active-fedora-11.0.0.rc1 spec/unit/checksum_spec.rb
active-fedora-10.1.0 spec/unit/checksum_spec.rb
active-fedora-10.1.0.rc1 spec/unit/checksum_spec.rb
active-fedora-9.7.2 spec/unit/checksum_spec.rb
active-fedora-10.0.0 spec/unit/checksum_spec.rb
active-fedora-10.0.0.beta4 spec/unit/checksum_spec.rb
active-fedora-10.0.0.beta3 spec/unit/checksum_spec.rb
active-fedora-10.0.0.beta2 spec/unit/checksum_spec.rb