RubyoffRails/Episode1 — pull request #3 by ralphos (2012-04-28 23:23:57+00:00)
Title: Completed Homework 

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.