Sha256: 90b4ac5b9d1a4a87cdb792d6c4345bf8f1fb9e99b7ca05fba71a59b17f7d383d

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

require_relative "spec_helper"
require "99_game"
describe "$deck" do
	describe "#length" do
		it "should == 54" do; expect($deck.length + 6).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 "UserCard" do
	describe "#num" do
		for key in UserCard.new._num.keys
			describe "#{key}" do
				it "should == #{UserCard.new._num[key]}" do; 
					expect(UserCard.new(key.to_s).num).to eq UserCard.new._num[key]
				end
			end
		end
	end
end
describe "Hand" do
	hand = Hand.new
	describe "#hand" do
		describe "#length" do
			it "should == 3" do; expect(hand.hand.length).to eq 3; end
		end
	end
	describe "#initialize" do
		describe "$deck" do
			it "should have three less cards after initialization" do
				deck1, hand, deck2 = $deck.length, Hand.new, $deck.length
				expect(deck1).to > deck2
			end
		end
	end
end
				

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
99_game-1.2.1 spec/99spec.rb
99_game-1.2.0 spec/99spec.rb
99_game-1.1.1 spec/99spec.rb
99_game-1.1.0 spec/99spec.rb
99_game-1.0.3 spec/99spec.rb
99_game-1.0.3.pre spec/99spec.rb