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

Add Tests and Fix Comparison Bug in Spoom::Location #585

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

alexcrocha
Copy link
Contributor

Summary

This PR addresses the lack of tests for the Spoom::Location class by introducing test coverage for its methods.

Details

  • Test Coverage: Added tests to ensure all methods in Spoom::Location function as expected.

  • Bug Fix: During the creation of these tests, a logical bug was identified in the implementation of the <=> method. The current implementation only compares strings, which leads to incorrect comparisons for integers (e.g., "11" < "2" evaluates as true, but 2 < 11 is the correct comparison).

@alexcrocha alexcrocha requested a review from a team as a code owner July 12, 2024 20:37
@alexcrocha alexcrocha requested review from andyw8 and vinistock July 12, 2024 20:37
test/spoom/location_test.rb Show resolved Hide resolved
test/spoom/location_test.rb Outdated Show resolved Hide resolved
lib/spoom/location.rb Outdated Show resolved Hide resolved
test/spoom/location_test.rb Outdated Show resolved Hide resolved
@andyw8
Copy link
Contributor

andyw8 commented Jul 12, 2024

Thanks for improving the coverage!

@alexcrocha alexcrocha requested a review from andyw8 July 12, 2024 22:25
test/spoom/location_test.rb Outdated Show resolved Hide resolved
test/spoom/location_test.rb Show resolved Hide resolved
Copy link
Collaborator

@Morriar Morriar left a comment

Choose a reason for hiding this comment

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

Thanks!

@alexcrocha alexcrocha merged commit 5e2c416 into main Jul 22, 2024
8 checks passed
@alexcrocha alexcrocha deleted the ar/location-tests branch July 22, 2024 17:00
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