Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Liberating Factories #6742

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions hyrax.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions spec/factories/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Where have all the factories gone? See [./lib/hyrax/specs/shared_specs/factories/](./lib/hyrax/specs/shared_specs/factories/).
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down