1st commit working - 2nd commit is half-finished and needs work on finishing takeaway tests for added menu spec.#2219
Open
david-ewan-campbell wants to merge 2 commits intomakersacademy:mainfrom
Open
Conversation
Author
|
1st commit had takeaway spec/takeaway class working well with doubles after a while and several reviews/revisions of code. Added menu class and ran into problems working independently and making code work - not enough test coverage to menu class from takeaway spec and struggled, running out of time over the weekend but will return to challenge to make it functional and progress with it. |
JordanManu
reviewed
Apr 4, 2022
| {name: 'Chicken Tikka Masala', price: 6.50}, | ||
| {name: 'Pilau Rice', price: 2.50}, | ||
| {name: 'Nan Bread', price: 1.95}, | ||
| ] |
| end | ||
|
|
||
| def list_of_dishes | ||
| dishes.map{ |item, price| menu_items <<item[:name]} |
| @@ -0,0 +1,23 @@ | |||
| class Menu | |||
|
|
|||
| attr_accessor :dishes, :menu | |||
There was a problem hiding this comment.
I feel like this could maybe be attr_reader? instead of accessor.
Should :menu be :menu_items?
| describe Takeaway do | ||
| subject(:takeaway) { described_class.new(menu: menu) } | ||
|
|
||
| let(:menu) { double(:menu, display: display_menu) } |
|
|
||
| context 'Menu' do | ||
| it 'displays a list of dishes' do | ||
| expect(menu.menu_items).to include['Chicken Tikka Masala'] |
There was a problem hiding this comment.
Maybe could've added some more dishes also
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
David Campbell
Please write your full name here to make it easier to find your pull request.
User stories
Please list which user stories you've implemented (delete the ones that don't apply).
README checklist
Does your README contains instructions for
Here is a pill that can help you write a great README!