Sha256: 4f1c8ae85fd173aba66f1849859ba1f7cb4af9ab2a9f22d5700ff7cc62a80459
Contents?: true
Size: 1.16 KB
Versions: 3
Compression:
Stored size: 1.16 KB
Contents
deck = Deck.new describe Deck do subject {Deck.new} describe "#length" do it "should == 54" do; expect(subject.cards.length).to eq 54; end end end describe Card do cards = ["Ace", "King", "Queen", "Jack", "Joker"] + (2..10).to_a describe "#value" do for card in cards describe "#{card}" do it "should == #{Card.new(card)._value}" do; expect(Card.new(card).value).to eq Card.new(card)._value end end end end end describe "converter" do context "when a number" do it "should return the input as a number" do expect(converter("5")).to eq 5 end end context "when an abbreveation" do it "should expand it" do expect(converter("K")).to eq "King" end end end describe Hand do hand = Hand.new Deck.new describe "#hand" do describe "#length" do subject { hand.hand.length } it "should == 3" do; expect( subject ).to eq 3; end end end describe "#initialize" do describe "Deck#length" do it "should have three less cards after initialization" do deck1, hand, deck2 = deck.cards.length, Hand.new( deck ), deck.cards.length expect( deck1 ).to be > deck2 end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
99_game-2.0.2 | spec/lib/99_game.rb |
99_game-2.0.1 | spec/lib/99_game.rb |
99_game-2.0.0 | spec/lib/99_game.rb |