joncodo / Crib

A crib engine to play the card game crib with AI and a card counter
3 stars 2 forks source link

game_spec.rb: Code review. #11

Closed scott-steadman closed 10 years ago

scott-steadman commented 10 years ago

Get rid of Game parameter in inner describes Reason: I believe it is redundant since you're already in a describe Game block.

scott-steadman commented 10 years ago

Refactor before(:each) into memoized getters. Reason: Prevent unnecessary object creation

Example Code:

def game
  @game ||= Game.new
end
scott-steadman commented 10 years ago

Remove the first test 'have a crib with four cards' Reason: It looks like the same methods are tested (better) in subsequent tests.