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

adding DRY to calculator #2297

Conversation

HannesAlexandersson
Copy link

This PR fixes issue #1.
It adds logic to the _check function that throws error if x or y is not an number.
Skärmbild 2024-09-03 124423

It removes that same functionality from each of the calculator functions and instead uses the _check function.

Tests are all passing:
Skärmbild 2024-09-03 124358

After tests have been run Ive change back the test code to the original code I.E 'describe.skip'
Skärmbild 2024-09-03 125652

modifying the code to keep it DRY. Removed repetetions and moved them in to a _check function
@dantharejabot
Copy link
Collaborator

Thanks for the submission, @HannesAlexandersson.

As mentioned in the contributing guidelines, I can only accept a pull request made to your branch.

This is a weird requirement, but it's necessary here in order to allow multiple people to contribute the same code. In the real world, most projects would expect you to open a Pull Request against the master base branch.

Click here to open this pull request to your branch

Want to contribute to the master branch? Open an issue in the partner repo and let's talk.

@HannesAlexandersson HannesAlexandersson deleted the fixing-issue-1 branch September 3, 2024 11:05
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.

2 participants