Conversation
…to Booker, and "total_cost" to Reservation
HotelWhat We're Looking ForTest Inspection
Code Review
Overall 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! Your code is clear and your design helps you achieve all the requirements. |
| @rooms = [] | ||
| @reservations = [] | ||
|
|
||
| if @inventory.class != Integer |
There was a problem hiding this comment.
This error checking should go ahead of the assignment to @inventory
lib/booker.rb
Outdated
|
|
||
| end | ||
|
|
||
| def all_rooms |
There was a problem hiding this comment.
How is this different than the rooms reader method.
test/booker_test.rb
Outdated
|
|
||
| end | ||
|
|
||
| describe "all_rooms method" do |
There was a problem hiding this comment.
I like this inventory feature, but your hotel was supposed to have 20 rooms.
|
|
||
| it "throws ArgumentError when there is no available rooms during the given date range" do | ||
| rooms = @new_booker.rooms | ||
| rooms[0].bookings << Hotel::Reservation.new(check_in: "2019-09-01", check_out: "2019-09-04", room: 1) |
There was a problem hiding this comment.
Consider storing the dates in variables so it is clear what you are testing.
| rooms[0].bookings << Hotel::Reservation.new(check_in: "2019-09-01", check_out: "2019-09-04", room: 1) | |
| check_in_date = "2019-09-01" | |
| check_out_date = "2019-09-04" |
test/room_test.rb
Outdated
| expect(Hotel::Room.new(number: 3).bookings.length).must_equal 0 | ||
| end | ||
|
|
||
| # it "adds booking to the bookings array if provided" do |
| expect(Hotel::Reservation.new(check_in: check_in, check_out: check_out).room).must_equal nil | ||
| end | ||
|
|
||
| it "is set up for specific attributes and data types" do |
There was a problem hiding this comment.
nice separation of Act/Arrange/Assert in this test.
| it "sets room to nil if not provided" do | ||
| check_in = "2019-09-01" | ||
| check_out = "2019-09-04" | ||
| expect(Hotel::Reservation.new(check_in: check_in, check_out: check_out).room).must_equal nil |
There was a problem hiding this comment.
I think there's a .must_equal_nil method.
|
|
||
| end | ||
|
|
||
| describe "make_reservation method" do |
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions