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.
I managed to complete the first assignment without any issues and writing the tests weren't a problem.
I got a little confused with the extra credit exercises.
For extra credit 1. I just created a Food class and converted the symbols to instances of Food. Not sure if this is what you were thinking?
For extra credit 2. I was also a little unsure as to what to do with a FoodBarge. I ended up creating a FoodBarge class, assuming that @foodbarge would be created as a new instance in IRB (since I found out that variables in your program aren't available in IRB). Now, when you call food_for on a FoodBarge object, it should check which class of animal it is dealing with and return an array of acceptable foods names' as strings.
So in IRB it'll be something like:
@foodbarge = FoodBarge.new
panda = Panda.new
food = @foodbarge.food_for(panda)
panda.feed(food)
When you call feed on panda it should go through the array of foods and if it likes? it it'll add to the meal count etc.
I got quite confused with writing the tests so I ended up writing the code and then trying to go back and write more tests. I guess my problem now is that I don't know what to test for exactly as well as being a little 'iffy' on rspec syntax.