Skip to content

Instantly share code, notes, and snippets.

@framallo
Last active October 19, 2015 18:13
Show Gist options
  • Save framallo/04058e80a0c2624f51ef to your computer and use it in GitHub Desktop.
Save framallo/04058e80a0c2624f51ef to your computer and use it in GitHub Desktop.
class Deck
attr_accessor :size
def size
cards.size
end
def cards
cards = []
52.times { cards << 1 }
cards
end
end
# binding.pry
require 'rspec'
require 'pry'
require_relative 'deck'
RSpec.describe do
it 'has 52 cards' do
expect(Deck.new.size).to eq(52)
end
it 'has 52 cards' do
expect(Deck.new.cards.first).to be_kind_of Integer
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment