Sha256: 0f0daaed7dfeb7fdaba0005dd42fdca187334080fc0e9617266cf9ff18a553d6

Contents?: true

Size: 1.59 KB

Versions: 11

Compression:

Stored size: 1.59 KB

Contents

require 'spec_helper'

describe ActiveFedora::WithMetadata::DefaultMetadataClassFactory do
  let(:parent) { double("Parent") }

  describe "default class attributes" do
    its(:metadata_base_class)    { is_expected.to eq(ActiveFedora::WithMetadata::MetadataNode) }
    its(:file_metadata_schemas)  { is_expected.to eq([ActiveFedora::WithMetadata::DefaultSchema]) }
    its(:file_metadata_strategy) { is_expected.to eq(ActiveFedora::WithMetadata::DefaultStrategy) }
  end

  describe "::build" do
    it "sets MetadataNode to the default schema using the default strategy" do
      expect(parent).to receive(:const_set)
      expect(parent).to receive(:delegate).with(:label, :label=, :label_changed?, to: :metadata_node)
      expect(parent).to receive(:delegate).with(:file_name, :file_name=, :file_name_changed?, to: :metadata_node)
      expect(parent).to receive(:delegate).with(:file_size, :file_size=, :file_size_changed?, to: :metadata_node)
      expect(parent).to receive(:delegate).with(:date_created, :date_created=, :date_created_changed?, to: :metadata_node)
      expect(parent).to receive(:delegate).with(:date_modified,
                                                :date_modified=,
                                                :date_modified_changed?,
                                                to: :metadata_node)
      expect(parent).to receive(:delegate).with(:byte_order, :byte_order=, :byte_order_changed?, to: :metadata_node)
      expect(parent).to receive(:delegate).with(:file_hash, :file_hash=, :file_hash_changed?, to: :metadata_node)
      subject.class.build(parent)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
active-fedora-10.3.0 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.3.0.rc2 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.3.0.rc1 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.2.1 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.2.0 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-11.0.0.rc1 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.1.0 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.1.0.rc1 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.0.0 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.0.0.beta4 spec/unit/with_metadata/default_metadata_class_factory_spec.rb
active-fedora-10.0.0.beta3 spec/unit/with_metadata/default_metadata_class_factory_spec.rb