diff --git a/spec/sword/adapters/hyacinth_adapter_spec.rb b/spec/sword/adapters/hyacinth_adapter_spec.rb index 99a793e..87e5df0 100644 --- a/spec/sword/adapters/hyacinth_adapter_spec.rb +++ b/spec/sword/adapters/hyacinth_adapter_spec.rb @@ -28,242 +28,6 @@ end end - ########################################## API/interface - describe 'API/interface' do - ########################################## API/interface: attr_readers - context 'has attr_reader for instance var' do - it 'digital_object_data' do - expect(subject).to respond_to(:digital_object_data) - end - - it 'dynamic_field_data' do - expect(subject).to respond_to(:dynamic_field_data) - end - - it 'hyacinth_server_response' do - expect(subject).to respond_to(:hyacinth_server_response) - end - end - - ########################################## API/interface: attr_accessors - context 'has attr_accessor for instance var' do - it 'abstract' do - expect(subject).to respond_to(:abstract) - expect(subject).to respond_to(:abstract=) - end - - it 'asset_import_filepath' do - expect(subject).to respond_to(:asset_import_filepath) - expect(subject).to respond_to(:asset_import_filepath=) - end - - it 'asset_parent_pid' do - expect(subject).to respond_to(:asset_parent_pid) - expect(subject).to respond_to(:asset_parent_pid=) - end - - it 'corporate_names' do - expect(subject).to respond_to(:corporate_names) - expect(subject).to respond_to(:corporate_names=) - end - - it 'date_issued_start' do - expect(subject).to respond_to(:date_issued_start) - expect(subject).to respond_to(:date_issued_start=) - end - - it 'deposited_by' do - expect(subject).to respond_to(:deposited_by) - expect(subject).to respond_to(:deposited_by=) - end - - it 'degree' do - expect(subject).to respond_to(:degree) - expect(subject).to respond_to(:degree=) - end - - it 'doi' do - expect(subject).to respond_to(:doi) - expect(subject).to respond_to(:doi=) - end - - it 'embargo_release_date' do - expect(subject).to respond_to(:embargo_release_date) - expect(subject).to respond_to(:embargo_release_date=) - end - - it 'genre_uri' do - expect(subject).to respond_to(:genre_uri) - expect(subject).to respond_to(:genre_uri=) - end - - it 'genre_value' do - expect(subject).to respond_to(:genre_value) - expect(subject).to respond_to(:genre_value=) - end - - it 'hyacinth_project' do - expect(subject).to respond_to(:hyacinth_project) - expect(subject).to respond_to(:hyacinth_project=) - end - - it 'hyacinth_user' do - expect(subject).to respond_to(:hyacinth_user) - expect(subject).to respond_to(:hyacinth_user=) - end - - it 'language_uri' do - expect(subject).to respond_to(:language_uri) - expect(subject).to respond_to(:language_uri=) - end - - it 'language_value' do - expect(subject).to respond_to(:language_value) - expect(subject).to respond_to(:language_value=) - end - - it 'license_uri' do - expect(subject).to respond_to(:license_uri) - expect(subject).to respond_to(:license_uri=) - end - - it 'no_op_post' do - expect(subject).to respond_to(:no_op_post) - expect(subject).to respond_to(:no_op_post=) - end - - it 'notes' do - expect(subject).to respond_to(:notes) - expect(subject).to respond_to(:notes=) - end - - it 'parent_publication' do - expect(subject).to respond_to(:parent_publication) - expect(subject).to respond_to(:parent_publication=) - end - - it 'personal_names' do - expect(subject).to respond_to(:personal_names) - expect(subject).to respond_to(:personal_names=) - end - - it 'title' do - expect(subject).to respond_to(:title) - expect(subject).to respond_to(:title=) - end - - it 'subjects' do - expect(subject).to respond_to(:subjects) - expect(subject).to respond_to(:subjects=) - end - - it 'type_of_resource' do - expect(subject).to respond_to(:type_of_resource) - expect(subject).to respond_to(:type_of_resource=) - end - - it 'uri' do - expect(subject).to respond_to(:uri) - expect(subject).to respond_to(:uri=) - end - - it 'use_and_reproduction_uri' do - expect(subject).to respond_to(:use_and_reproduction_uri) - expect(subject).to respond_to(:use_and_reproduction_uri=) - end - end - - ########################################## API/interface: encoding methods - context 'has the following instance method to encode metadata into hyacinth-ready format:' do - it '#encode_abstract' do - expect(subject).to respond_to(:encode_abstract) - end - - it '#encode_degree' do - expect(subject).to respond_to(:encode_degree) - end - - it '#encode_date_issued' do - expect(subject).to respond_to(:encode_date_issued) - end - - it '#encode_deposited_by' do - expect(subject).to respond_to(:encode_deposited_by) - end - - it '#encode_embargo_release_date' do - expect(subject).to respond_to(:encode_embargo_release_date) - end - - it '#encode_genre' do - expect(subject).to respond_to(:encode_genre) - end - - it '#encode_language' do - expect(subject).to respond_to(:encode_language) - end - - it '#encode_license' do - expect(subject).to respond_to(:encode_license) - end - - it '#encode_names' do - expect(subject).to respond_to(:encode_names) - end - - it '#encode_notes' do - expect(subject).to respond_to(:encode_notes) - end - - it '#encode_parent_publication' do - expect(subject).to respond_to(:encode_parent_publication) - end - - it '#encode_subjects' do - expect(subject).to respond_to(:encode_subjects) - end - - it '#encode_title' do - expect(subject).to respond_to(:encode_title) - end - - it '#encode_type_of_resource' do - expect(subject).to respond_to(:encode_type_of_resource) - end - - it '#encode_use_and_reproduction' do - expect(subject).to respond_to(:encode_use_and_reproduction) - end - end - - ########################################## API/interface: misc methods - context 'has the following miscellaneous instance method:' do - it '#compose_internal_format_item used to create the JSON format used to ingest objects into Hyacinth via AP' do - expect(subject).to respond_to(:compose_internal_format_item) - end - - it '#compose_internal_format_asset used to create the JSON format used to ingest objects into Hyacinth via AP' do - expect(subject).to respond_to(:compose_internal_format_asset).with(2).arguments - end - - it '#ingest_item used to ingest item objects into Hyacinth via API' do - expect(subject).to respond_to(:ingest_item) - end - - it '#ingest_asset used to ingest asset objects into Hyacinth via API' do - expect(subject).to respond_to(:ingest_asset).with(2).arguments - end - - it '#last_ingest_successful? returns true if last ingest was successfull' do - expect(subject).to respond_to(:last_ingest_successful?) - end - - it '#pid_last_ingest returns the pid sent back by hyacinth for the ingested object' do - expect(subject).to respond_to(:pid_last_ingest) - end - end - end - ########################################## encoding methods functionality specs describe 'encode methods' do let(:hyacinth_adapter) { Sword::Adapters::HyacinthAdapter.new }