Last active
October 19, 2015 18:13
-
-
Save framallo/04058e80a0c2624f51ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Deck | |
attr_accessor :size | |
def size | |
cards.size | |
end | |
def cards | |
cards = [] | |
52.times { cards << 1 } | |
cards | |
end | |
end | |
# binding.pry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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