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

Fixes #622: Valkyrie ID should equal string equivalent of ID to string #782

Merged
merged 3 commits into from
Nov 12, 2019

Conversation

josh-levinson
Copy link

@josh-levinson josh-levinson commented Oct 22, 2019

Fixes Issue #622 (seems to be tagging the release, see: #662)

Valkyrie::ID#eql? and == should return true when a string is compared with an equivalent Valkyrie::ID

Added test to verify this behavior. The following examples should work per the example:

[11] pry(main)> id = Valkyrie::ID.new('abc')
=> #<Valkyrie::ID:0x007fdee25d4760 @id="abc">
[12] pry(main)> id.eql?('abc')
=> true
[13] pry(main)> id == 'abc'
=> true
[14] pry(main)> id == 'def'
=> false
[15] pry(main)> id == Valkyrie::ID.new('abc')
=> true

Following tests should pass: bundle exec rspec spec/valkyrie/types_spec.rb should verify this behavior.

Note: I just submitted my Individual Contributors License Agreement to Samvera Legal so not sure how long it takes to verify.

Copy link
Collaborator

@tpendragon tpendragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just fix up the rubocop? rubocop -a should take care of it.

@josh-levinson
Copy link
Author

josh-levinson commented Oct 22, 2019

Fixed per rubocop suggestions. Also fixed the test to do what is expected rather than just checking Valkyrie ID vs resource ID. But now tests resource ID vs actual string

@josh-levinson
Copy link
Author

CLA has been approved and Robocop changes were made as requested.

@no-reply
Copy link
Contributor

no-reply commented Nov 5, 2019

Confirming @jlevnhv's CLA.

@tpendragon tpendragon merged commit 01e9be4 into samvera:master Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants