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

OOP school library: unit tests #8

Merged
merged 5 commits into from
Nov 15, 2023
Merged

OOP school library: unit tests #8

merged 5 commits into from
Nov 15, 2023

Conversation

sadaf-Daneshgar
Copy link
Owner

New Features

  • 🔰 Add unit tests for all the methods in all the classes:
    • Book
    • Person
    • Student
    • Teacher
    • Classroom
    • Rental

👥 Authors

@sadaf-Daneshgar
@MohammadYaser

Copy link

@mckent05 mckent05 left a comment

Choose a reason for hiding this comment

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

Hi @sadaf-Daneshgar,

STATUS: CHANGES REQUIRED ♻️ ♻️

Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!
almost there

Highlights

  • All linter checks are passing ✔️ ✔️
  • Your PR is professional 👍 👍
  • You did well testing all classes and decorators 👍 👍

Required Changes ♻️

Check the comments under the review.

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Comment on lines +47 to +51
it 'adds rental' do
book = double('book')
expect(Rental).to receive(:new).with(any_args).and_return(double('rental'))
person.add_rental('2023-01-01', book)
end

Choose a reason for hiding this comment

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

  • You have done well so far, please complete this test after calling the add_book method to ensure that the rentals array contains the rental added. Please fix this 🙏

Comment on lines 1 to 27
require 'rspec'
require_relative '../trimmer_decorator'

class TestNameable < Nameable
def correct_name
'Ali'
end
end

describe Decorator do
let(:nameable_instance) { TestNameable.new }
let(:decorator_instance) { Decorator.new(nameable_instance) }

it 'raises NotImplementedError for correct_name when called on the base class' do
expect do
Nameable.new.correct_name
end.to raise_error(NotImplementedError, 'Subclasses must implement the correct_name method.')
end

it 'returns the correct name using the decorator' do
expect(decorator_instance.correct_name).to eq('Ali')
end

it 'updates the nameable attribute' do
new_nameable_instance = TestNameable.new
decorator_instance.nameable = new_nameable_instance
expect(decorator_instance.correct_name).to eq('Ali')

Choose a reason for hiding this comment

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

  • You have done well so far, but please write tests to show that your trimmer decorator works as expected and gets the first 10 letters of the name when the name has more than 10 characters. Please fix this 👍 👍

Copy link

@codepantha codepantha left a comment

Choose a reason for hiding this comment

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

APPROVED 🟢 ✔️

Hi team👋,

Great job implementing the required changes 👏
Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Highlights 🎯

✔️ Descriptive PR
✔️ All tests are passing ✔️
✔️ No linter errors 🟢

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

@sadaf-Daneshgar sadaf-Daneshgar merged commit 135303e into development Nov 15, 2023
2 checks passed
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

4 participants