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

Adding Bulkrax::EntrySpecHelper #726

Merged
merged 1 commit into from
Feb 6, 2023
Merged

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Feb 3, 2023

With this commit, we're introducing
Bulkrax::EntrySpecHelper.entry_for, a public api method for downstream Bulkrax spec support.

Release Notes

The newly provided Bulkrax::EntrySpecHelper.entry_for method is intended to provide a consistent mechanism for testing your entry parser logic without needing to jump through the entire import cycle for that entry.

To use, will need to explicitly require it in your test suite:

require 'bulkrax/entry_spec_helper'

RSpec.describe MyParser do
  let(:entry) { Bulkrax::EntrySpecHelper.entry_for(...) }
end

Each of the entry types have slightly different parameter requirements for instantiation. The best source to see those is in Bulkrax's ./spec/bulkrax/entry_spec_helper_spec.rb file

Closes: #714

Related to:

@jeremyf jeremyf added enhancement for release notes (New feature or request) patch-ver for release notes labels Feb 3, 2023
With this commit, we're introducing
`Bulkrax::EntrySpecHelper.entry_for`, a public api method for downstream
Bulkrax spec support.

**Release Notes**

The newly provided `Bulkrax::EntrySpecHelper.entry_for` method is
intended to provide a consistent mechanism for testing your entry parser
logic without needing to jump through the entire import cycle for that
entry.

To use, will need to explicitly require it in your test suite:

```ruby
require 'bulkrax/entry_spec_helper'

RSpec.describe MyParser do
  let(:entry) { Bulkrax::EntrySpecHelper.entry_for(...) }
end
```

Each of the entry types have slightly different parameter requirements
for instantiation.  The best source to see those is in Bulkrax's
`./spec/bulkrax/entry_spec_helper_spec.rb` file

Closes: #714

Related to:

- scientist-softserv/adventist-dl#246
- #719
- #705
@jeremyf jeremyf force-pushed the jeremyf-adding-bulkrax-spec-helpers branch from 6990127 to 36855e9 Compare February 3, 2023 17:04
@jeremyf jeremyf merged commit d7fe87f into main Feb 6, 2023
@jeremyf jeremyf deleted the jeremyf-adding-bulkrax-spec-helpers branch February 6, 2023 13:23
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this pull request Oct 4, 2023
This commit includes two things:

1. Favor Bulkrax::EntrySpecHelper provided by Bulkrax (for which the
   removed code was a prototype).
2. Use the existing spec to determine what the default work type should
   be (instead of relying on a random assignment based on the first
   element of the registered curation concerns)

And from this commit, we have a passing test!

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/538
- samvera/bulkrax#726
- samvera/bulkrax#719
- samvera/bulkrax#742
- samvera/hyku#1811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement for release notes (New feature or request) patch-ver for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a test helper for downstream implementations to test their parsers
2 participants