Panda and Tiger Level #12

Open
wants to merge 5 commits into
from

Conversation

Projects
None yet
2 participants

buk commented Nov 18, 2012

No description provided.

@jwo jwo commented on the diff Nov 20, 2012

blackjack.rb
@@ -75,6 +75,9 @@ def initialize
def hit
@player_hand.hit!(@deck)
+ if @player_hand.value > 21
+ self.stand
@jwo

jwo Nov 20, 2012

Owner

You don't need to call self here --- if you just say stand, it'll call the local method on the current object

@jwo jwo commented on the diff Nov 20, 2012

blackjack.rb
@@ -225,6 +228,14 @@ def inspect
game.status[:winner].should_not be_nil
end
+ it "should stand if the player busts" do
+ game = Game.new
+ unless game.status[:player_value] < 21
@jwo

jwo Nov 20, 2012

Owner

In a test, you probably don't want to seem wishy-washy... this "unless" makes it seem like you don't KNOW what's going on. You'll probably want to setup the test that you do know what's going on (because you set the environment beforehand),

Owner

jwo commented Nov 20, 2012

Nice job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment