Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage to achieve 100% branch and line coverage for the Kalshi API client library. The tests cover previously untested code paths including error handling, validation edge cases, and class-level method invocations.
- Adds validation tests for invalid filter parameters (both keys and values)
- Adds tests for the Contract class's
propertizemethod to cover the inherited class path - Adds tests for Client error handling and the singleton client accessor
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/kalshi/market/series_list_test.rb | Improves test naming clarity and adds validation test for invalid filter value types to achieve branch coverage |
| test/kalshi/contract_test.rb | New test file covering the Contract class's property definition mechanism including edge cases |
| test/kalshi/client_test.rb | New test file covering Client error handling and the module-level client singleton pattern |
| # rubocop:enable Lint/ConstantDefinitionInBlock | ||
|
|
||
| it 'handles existing definitions' do | ||
| # This test just ensures the class definition above runs and exercises the code path |
There was a problem hiding this comment.
The test comment is redundant and states the obvious. Either remove the comment entirely or make it more informative by explaining why this edge case matters for coverage (e.g., "Ensures propertize handles properties that already exist via Reform's property method").
Suggested change
| # This test just ensures the class definition above runs and exercises the code path | |
| # Ensures propertize correctly adds properties on a class that already defines properties via property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.