-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow filter versions within a range #18
Conversation
ac27ab6
to
be48993
Compare
@@ -60,7 +60,7 @@ | |||
|
|||
context 'when given a random value' do | |||
it 'does not returns a version' do | |||
expect(subject.find_next('2024-04-01')).to be_nil | |||
expect { subject.find_next('2025-04-01') }.to raise_error(RuntimeError, 'Version \'2025-04-01\' not found') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was returning nil because the value exists but was the last one (just like the context in line 55)
|
||
context 'with only to' do | ||
it 'filters versions by <= to' do | ||
expect(subject.in_range(nil, '2024-09-20').count).to eq(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if subject.in_range(nil, nil)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no filter is applied, so it returns the full list. do you want me to add this case in the spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or would you expect a different behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be great to have this case covered since is the only one this test is missing and is one of the possible combinations :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
be48993
to
4654918
Compare
🚪 Why?
For Public APi automatic testing epic we will need to read a list of Version within a range
🔑 What?
Allow filtering Versions by range using the name.
In Public API we are using dates as names i.e 2024-01-01, but it will work the same with SemVer because it will use alphabet comparison.