Closed scott-steadman closed 10 years ago
I suggest wrapping the both describes in a `describe Deck do
block and getting rid of the Deck parameter in the current describe blocks.
Refactor the before(:each) into a deck method. Reason: DRY up your code and lazily create Decks.
Example code:
def deck
@deck ||= Deck.new
end
should_deal_a_card should make sure a Card was returned. Reason: testing for nil will be false if a non-Card is returned as well...
it 'should deal a card' do
expect(@deck.deal_one.class).to eq(Card)
end
Use .to be_false
rather than .to eq(false)
Unless you are specifically testing for false as opposed to nil.
Reason: This looks like how rspec intended it to be used.
Awesome. This is my first RSpec project so I'm just getting used to it
Individual recommendations in comments on this ticket.