Conversation
…e Data_Range test and Room test
…t greater than end_date and the length not equals to 0 updating the overlap? and nights method
…. Test dates length 0 and all the case scenarios for ovelap? method
…servations by room and date
…oring and comments
…om and a given date range test
HotelSection 1: Major Learning Goals
Section 2: Code Review and Testing Requirements
Section 3: Feature Requirements
Overall Feedback
Additional FeedbackGreat work overall! You've built your first project with minimal starting code. This represents an incredible milestone in your journey, and you should be proud of yourself! I am particularly impressed by the way that you that you broke up complex logic and encapsulated functionality in helper methods. This helps to make your code more readable, flexible, and DRY. It is clear that you have met the learning goals around object composition in a complex system and TDD. I do see some room for improvement around the thoroughness of your test cases, particularly for edge cases. Given how thorough the Keep up the hard work! Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
| attr_reader :rooms, :date_range, :reservations | ||
|
|
||
| def initialize | ||
| @rooms = generate_rooms |
| return @rooms | ||
| end | ||
|
|
||
| def total_reservations |
There was a problem hiding this comment.
Consider whether this reader method is necessary. Would .reservations suffice?
| # It returns an array with the list of reservations for a specific date. | ||
| # date = date instance. | ||
| def reservations_by_date(date) | ||
| total_by_date = @reservations.select do |reservation| |
There was a problem hiding this comment.
Good use of an enumerable method.
| def make_resevation(date_range) | ||
| available_rooms = get_available_rooms(date_range) | ||
| if available_rooms.length < 1 | ||
| raise ArgumentError |
There was a problem hiding this comment.
Consider whether a custom exception would be appropriate here.
| expect(rooms).must_be :>, 1 | ||
| end | ||
|
|
||
| it "raises an error if there are not available rooms" do |
There was a problem hiding this comment.
Minor note: I think this test belongs in the make_reservation describe block or a get_available_rooms. It took me a minute to find it :)
Assignment Submission: Hotel
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection