diff --git a/hyrax.gemspec b/hyrax.gemspec index 99111ec69e..8f057e4e70 100644 --- a/hyrax.gemspec +++ b/hyrax.gemspec @@ -18,13 +18,7 @@ SUMMARY spec.homepage = "http://github.com/samvera/hyrax" spec.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR).reject do |f| - f == 'bin/rails' || - # We want for downstream implementations to be able to leverage the various Hyrax factories. - # As such we need them to be available in the .gem file. See `./lib/hyrax/spec/factories.rb` - # for more details. - (File.dirname(f) =~ %r{\A"?spec\/?} && - File.dirname(f) !~ %r{\A"?spec\/(factories|assets|support)\/?} - ) + f == 'bin/rails' || File.dirname(f) =~ %r{\A"?spec\/?} end spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) } spec.name = "hyrax" diff --git a/spec/factories/access_control.rb b/lib/hyrax/specs/shared_specs/factories/access_control.rb similarity index 100% rename from spec/factories/access_control.rb rename to lib/hyrax/specs/shared_specs/factories/access_control.rb diff --git a/spec/factories/admin_sets.rb b/lib/hyrax/specs/shared_specs/factories/admin_sets.rb similarity index 100% rename from spec/factories/admin_sets.rb rename to lib/hyrax/specs/shared_specs/factories/admin_sets.rb diff --git a/spec/factories/admin_sets_lw.rb b/lib/hyrax/specs/shared_specs/factories/admin_sets_lw.rb similarity index 100% rename from spec/factories/admin_sets_lw.rb rename to lib/hyrax/specs/shared_specs/factories/admin_sets_lw.rb diff --git a/spec/factories/administrative_sets.rb b/lib/hyrax/specs/shared_specs/factories/administrative_sets.rb similarity index 100% rename from spec/factories/administrative_sets.rb rename to lib/hyrax/specs/shared_specs/factories/administrative_sets.rb diff --git a/spec/factories/api_items.rb b/lib/hyrax/specs/shared_specs/factories/api_items.rb similarity index 100% rename from spec/factories/api_items.rb rename to lib/hyrax/specs/shared_specs/factories/api_items.rb diff --git a/spec/factories/collection_branding_infos.rb b/lib/hyrax/specs/shared_specs/factories/collection_branding_infos.rb similarity index 100% rename from spec/factories/collection_branding_infos.rb rename to lib/hyrax/specs/shared_specs/factories/collection_branding_infos.rb diff --git a/spec/factories/collection_type_participants.rb b/lib/hyrax/specs/shared_specs/factories/collection_type_participants.rb similarity index 100% rename from spec/factories/collection_type_participants.rb rename to lib/hyrax/specs/shared_specs/factories/collection_type_participants.rb diff --git a/spec/factories/collection_types.rb b/lib/hyrax/specs/shared_specs/factories/collection_types.rb similarity index 100% rename from spec/factories/collection_types.rb rename to lib/hyrax/specs/shared_specs/factories/collection_types.rb diff --git a/spec/factories/collections.rb b/lib/hyrax/specs/shared_specs/factories/collections.rb similarity index 100% rename from spec/factories/collections.rb rename to lib/hyrax/specs/shared_specs/factories/collections.rb diff --git a/spec/factories/collections_factory.rb b/lib/hyrax/specs/shared_specs/factories/collections_factory.rb similarity index 100% rename from spec/factories/collections_factory.rb rename to lib/hyrax/specs/shared_specs/factories/collections_factory.rb diff --git a/spec/factories/content_blocks.rb b/lib/hyrax/specs/shared_specs/factories/content_blocks.rb similarity index 100% rename from spec/factories/content_blocks.rb rename to lib/hyrax/specs/shared_specs/factories/content_blocks.rb diff --git a/spec/factories/counter_metrics.rb b/lib/hyrax/specs/shared_specs/factories/counter_metrics.rb similarity index 100% rename from spec/factories/counter_metrics.rb rename to lib/hyrax/specs/shared_specs/factories/counter_metrics.rb diff --git a/spec/factories/featured_works.rb b/lib/hyrax/specs/shared_specs/factories/featured_works.rb similarity index 100% rename from spec/factories/featured_works.rb rename to lib/hyrax/specs/shared_specs/factories/featured_works.rb diff --git a/spec/factories/file_sets.rb b/lib/hyrax/specs/shared_specs/factories/file_sets.rb similarity index 100% rename from spec/factories/file_sets.rb rename to lib/hyrax/specs/shared_specs/factories/file_sets.rb diff --git a/spec/factories/generic_works.rb b/lib/hyrax/specs/shared_specs/factories/generic_works.rb similarity index 100% rename from spec/factories/generic_works.rb rename to lib/hyrax/specs/shared_specs/factories/generic_works.rb diff --git a/spec/factories/hyrax_collection.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_collection.rb similarity index 100% rename from spec/factories/hyrax_collection.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_collection.rb diff --git a/spec/factories/hyrax_default_admin_set.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_default_admin_set.rb similarity index 100% rename from spec/factories/hyrax_default_admin_set.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_default_admin_set.rb diff --git a/spec/factories/hyrax_embargo.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_embargo.rb similarity index 100% rename from spec/factories/hyrax_embargo.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_embargo.rb diff --git a/spec/factories/hyrax_file_metadata.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_file_metadata.rb similarity index 100% rename from spec/factories/hyrax_file_metadata.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_file_metadata.rb diff --git a/spec/factories/hyrax_file_set.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_file_set.rb similarity index 100% rename from spec/factories/hyrax_file_set.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_file_set.rb diff --git a/spec/factories/hyrax_lease.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_lease.rb similarity index 100% rename from spec/factories/hyrax_lease.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_lease.rb diff --git a/spec/factories/hyrax_resource.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_resource.rb similarity index 100% rename from spec/factories/hyrax_resource.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_resource.rb diff --git a/spec/factories/hyrax_work.rb b/lib/hyrax/specs/shared_specs/factories/hyrax_work.rb similarity index 100% rename from spec/factories/hyrax_work.rb rename to lib/hyrax/specs/shared_specs/factories/hyrax_work.rb diff --git a/spec/factories/object_id.rb b/lib/hyrax/specs/shared_specs/factories/object_id.rb similarity index 100% rename from spec/factories/object_id.rb rename to lib/hyrax/specs/shared_specs/factories/object_id.rb diff --git a/spec/factories/operations.rb b/lib/hyrax/specs/shared_specs/factories/operations.rb similarity index 100% rename from spec/factories/operations.rb rename to lib/hyrax/specs/shared_specs/factories/operations.rb diff --git a/spec/factories/permission.rb b/lib/hyrax/specs/shared_specs/factories/permission.rb similarity index 100% rename from spec/factories/permission.rb rename to lib/hyrax/specs/shared_specs/factories/permission.rb diff --git a/spec/factories/permission_template_accesses.rb b/lib/hyrax/specs/shared_specs/factories/permission_template_accesses.rb similarity index 100% rename from spec/factories/permission_template_accesses.rb rename to lib/hyrax/specs/shared_specs/factories/permission_template_accesses.rb diff --git a/spec/factories/permission_templates.rb b/lib/hyrax/specs/shared_specs/factories/permission_templates.rb similarity index 100% rename from spec/factories/permission_templates.rb rename to lib/hyrax/specs/shared_specs/factories/permission_templates.rb diff --git a/spec/factories/proxy_deposit_requests.rb b/lib/hyrax/specs/shared_specs/factories/proxy_deposit_requests.rb similarity index 100% rename from spec/factories/proxy_deposit_requests.rb rename to lib/hyrax/specs/shared_specs/factories/proxy_deposit_requests.rb diff --git a/spec/factories/single_use_links.rb b/lib/hyrax/specs/shared_specs/factories/single_use_links.rb similarity index 100% rename from spec/factories/single_use_links.rb rename to lib/hyrax/specs/shared_specs/factories/single_use_links.rb diff --git a/spec/factories/sipity_entities.rb b/lib/hyrax/specs/shared_specs/factories/sipity_entities.rb similarity index 100% rename from spec/factories/sipity_entities.rb rename to lib/hyrax/specs/shared_specs/factories/sipity_entities.rb diff --git a/spec/factories/uploaded_files.rb b/lib/hyrax/specs/shared_specs/factories/uploaded_files.rb similarity index 100% rename from spec/factories/uploaded_files.rb rename to lib/hyrax/specs/shared_specs/factories/uploaded_files.rb diff --git a/spec/factories/users.rb b/lib/hyrax/specs/shared_specs/factories/users.rb similarity index 100% rename from spec/factories/users.rb rename to lib/hyrax/specs/shared_specs/factories/users.rb diff --git a/spec/factories/workflow_actions.rb b/lib/hyrax/specs/shared_specs/factories/workflow_actions.rb similarity index 100% rename from spec/factories/workflow_actions.rb rename to lib/hyrax/specs/shared_specs/factories/workflow_actions.rb diff --git a/spec/factories/workflow_states.rb b/lib/hyrax/specs/shared_specs/factories/workflow_states.rb similarity index 100% rename from spec/factories/workflow_states.rb rename to lib/hyrax/specs/shared_specs/factories/workflow_states.rb diff --git a/spec/factories/workflows.rb b/lib/hyrax/specs/shared_specs/factories/workflows.rb similarity index 100% rename from spec/factories/workflows.rb rename to lib/hyrax/specs/shared_specs/factories/workflows.rb diff --git a/spec/factories/README.md b/spec/factories/README.md new file mode 100644 index 0000000000..f98572317e --- /dev/null +++ b/spec/factories/README.md @@ -0,0 +1 @@ +Where have all the factories gone? See [./lib/hyrax/specs/shared_specs/factories/](./lib/hyrax/specs/shared_specs/factories/). diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6de2b804e5..a023536bab 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -99,7 +99,7 @@ def to_rdf_representation require 'hyrax/specs/shared_specs/factories/strategies/valkyrie_resource' FactoryBot.register_strategy(:valkyrie_create, ValkyrieCreateStrategy) FactoryBot.register_strategy(:json, JsonStrategy) -FactoryBot.definition_file_paths = [File.expand_path("../factories", __FILE__)] +FactoryBot.definition_file_paths = [File.expand_path("../../lib/hyrax/specs/shared_specs/factories", __FILE__)] FactoryBot.find_definitions require 'rspec/mocks'