Skip to content

Commit

Permalink
♻️ Liberating Factories
Browse files Browse the repository at this point in the history
To clarify these are available in downstream applications, and by moving
to lib we're demonstrating that these are part of the Hyrax interface.
  • Loading branch information
jeremyf authored and tamsin woo committed Mar 21, 2024
1 parent bfa53c4 commit 5f5f306
Show file tree
Hide file tree
Showing 39 changed files with 3 additions and 8 deletions.
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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

0 comments on commit 5f5f306

Please sign in to comment.