Sha256: a23280d701f0f3bcdbfa7d7c48c4bd07abd401530d616dcfe41ad050db8f0494

Contents?: true

Size: 839 Bytes

Versions: 4

Compression:

Stored size: 839 Bytes

Contents

require 'spec_helper'
require 'asset_cloud/metadata'

module AssetCloud
  describe Metadata do
    it "exposes the checksum" do
      exist = true
      size = 1
      created_at = Time.utc(2020, 5, 19, 13, 14, 15)
      updated_at = Time.utc(2020, 5, 19, 16, 17, 18)
      value_hash = "abc123"
      checksum = "def456"

      metadata = Metadata.new(exist, size, created_at, updated_at, value_hash, checksum)

      expect(metadata.checksum).to(eq("def456"))
    end

    it "defaults the checksum to nil if not provided" do
      exist = true
      size = 1
      created_at = Time.utc(2020, 5, 19, 13, 14, 15)
      updated_at = Time.utc(2020, 5, 19, 16, 17, 18)
      value_hash = "abc123"

      metadata = Metadata.new(exist, size, created_at, updated_at, value_hash)

      expect(metadata.checksum).to(be(nil))
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asset_cloud-2.7.1 spec/asset_cloud/metadata_spec.rb
asset_cloud-2.7.0 spec/asset_cloud/metadata_spec.rb
asset_cloud-2.6.1 spec/asset_cloud/metadata_spec.rb
asset_cloud-2.6.0 spec/asset_cloud/metadata_spec.rb