RubyoffRails/Episode1-Summer2012 — pull request #39 by ThePomodoro (2014-02-10 02:33:57+00:00)
Title: Feature: Completed all examples

Hi Jesse. I've completed the Panda, Tiger, Eagle examples. Please let me know how I did.

A couple of things:

1) I'm a bit unsure how to cope with the .idea file issue you mentioned. I'm guessing I'm pushing lots of supporting files used by my IDE to the repository, which must be annoying - could you help me with that by telling me how to get git to ignore them?

2) To complete the Eagle example I had to tell the Game.status method when someone had stood. So I called Game.status with a passed symbol, which was normally :unstood to indicate that no one had stood (forcing it to hide the cards). If Game.status was invoked from Game.stand, it was passed the :stood symbol, which told it that the game had been stood. Then it knew to reveal the dealer cards. However, all this meant that I had to change every method call to Game.stood, which seems inefficient and clunky.

What is a better way?

3) I tried to write an rspec test to ensure that the game stood for the player when the player bust. I thought that would involve setting the player_hand value to 21, and then hitting, and then checking that the game received 'stand' as a method call. Can't get it to work though. Can you tell me what I'm doing wrong?

Onward and upward! Thanks.