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 new Armstrong number tests #2

Merged
merged 3 commits into from
Apr 1, 2024
Merged

Add new Armstrong number tests #2

merged 3 commits into from
Apr 1, 2024

Conversation

rabestro
Copy link
Owner

@rabestro rabestro commented Apr 1, 2024

Added several new test cases for Armstrong numbers to the exercism API tests suite. This includes checks for a seven digit Armstrong number, error scenarios when number is not specified, a seven digit number that's not Armstrong, and when there are no two digit Armstrong numbers. This will enhance the test coverage and ensure the robustness of the API.

Summary by CodeRabbit

  • New Features
    • Introduced test cases for verifying seven-digit Armstrong numbers.
    • Added a test case to ensure single-digit numbers are recognized as Armstrong numbers.
    • Implemented a test to confirm that there are no two-digit Armstrong numbers.
    • Validated through testing that zero is considered an Armstrong number.

Added several new test cases for Armstrong numbers to the exercism API tests suite. This includes checks for a seven digit Armstrong number, error scenarios when number is not specified, a seven digit number that's not Armstrong, and when there are no two digit Armstrong numbers. This will enhance the test coverage and ensure the robustness of the API.
@rabestro rabestro self-assigned this Apr 1, 2024
Copy link
Contributor

coderabbitai bot commented Apr 1, 2024

Warning

Rate Limit Exceeded

@rabestro has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 1 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between a7e50b6 and 195e6d6.

Walkthrough

The updates primarily enhance the Armstrong Numbers API tests in the exercism-api-tests project. They introduce new test cases for seven-digit Armstrong numbers, handling errors when no number is specified, and specific scenarios such as single-digit Armstrong numbers, the absence of two-digit Armstrong numbers, and zero being an Armstrong number. These changes aim to ensure the API accurately identifies Armstrong numbers across various scenarios, improving its reliability and user experience.

Changes

Files Change Summaries
.../Armstrong Numbers/A seven digit number that is an Armstrong number.bru, .../Armstrong Numbers/Zero is Armstrong numbers.bru Introduced test cases for seven-digit Armstrong numbers and updated the assertion for zero being an Armstrong number.
.../Armstrong Numbers/Error when number is not specified.bru Added a test scenario for error handling when a number is not specified, expecting a 400 status code and a specific error message.
.../Armstrong Numbers/Single digits are Armstrong numbers.bru, .../Armstrong Numbers/There are no two digit Armstrong numbers.bru Modified assertion checks for single-digit Armstrong numbers and introduced a test case for the non-existence of two-digit Armstrong numbers.

🌟✨🐇✨🌟
In the realm of digits and sums,
Where numbers dance and logic hums.
A rabbit hopped, with tests anew,
For Armstrong's secrets, through and through.
Zero's charm, and sevens' might,
In code, they shine, oh so bright.
🌟✨🐇✨🌟

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a6bbcf2 and a2c42ca.
Files selected for processing (6)
  • exercism-api-tests/Armstrong Numbers/A seven digit number that is an Armstrong number.bru (1 hunks)
  • exercism-api-tests/Armstrong Numbers/A seven digit number that is not an Armstrong number.bru (1 hunks)
  • exercism-api-tests/Armstrong Numbers/Error when number is not specified.bru (1 hunks)
  • exercism-api-tests/Armstrong Numbers/Single digits are Armstrong numbers.bru (1 hunks)
  • exercism-api-tests/Armstrong Numbers/There are no two digit Armstrong numbers.bru (1 hunks)
  • exercism-api-tests/Armstrong Numbers/Zero is Armstrong numbers.bru (1 hunks)
Files skipped from review due to trivial changes (1)
  • exercism-api-tests/Armstrong Numbers/Zero is Armstrong numbers.bru
Additional Context Used
Additional comments not posted (3)
exercism-api-tests/Armstrong Numbers/There are no two digit Armstrong numbers.bru (1)

18-18: The assertion isFalsy is correctly used to verify that there are no two-digit Armstrong numbers, specifically testing the number 10. This test case is well-structured and follows the expected format for HTTP tests.

exercism-api-tests/Armstrong Numbers/Error when number is not specified.bru (1)

14-17: The assertions for checking a 400 status code and the presence of an error message containing "pass a number" are correctly implemented. This test case appropriately enhances the API's error handling capabilities for requests without a specified number.

exercism-api-tests/Armstrong Numbers/A seven digit number that is an Armstrong number.bru (1)

18-18: The assertion isTruthy is correctly used to verify that the number 9926315 is an Armstrong number. This test case is well-structured and follows the expected format for HTTP tests.

rabestro and others added 2 commits April 1, 2024 22:31
… is not an Armstrong number.bru

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
… is not an Armstrong number.bru

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a2c42ca and a7e50b6.
Files selected for processing (1)
  • exercism-api-tests/Armstrong Numbers/A seven digit number that is not an Armstrong number.bru (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • exercism-api-tests/Armstrong Numbers/A seven digit number that is not an Armstrong number.bru
Additional Context Used

@rabestro rabestro merged commit 479c535 into main Apr 1, 2024
@rabestro rabestro deleted the develop branch April 1, 2024 19:36
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.

None yet

1 participant