cardshark 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,17 +0,0 @@
1
- require 'cardshark/french_deck'
2
-
3
- describe Cardshark::FrenchDeck do
4
- #create a french (standard) deck
5
- before :all do
6
- @french = Cardshark::FrenchDeck.new
7
- @french_with_jokers = Cardshark::FrenchDeck.new(:include_jokers => true)
8
- end
9
-
10
- it 'should contain 52 cards' do
11
- @french.size.should == 52
12
- end
13
-
14
- it 'should contain 54 cards' do
15
- @french_with_jokers.size == 54
16
- end
17
- end
@@ -1,13 +0,0 @@
1
- require 'cardshark/piquet_deck'
2
-
3
- describe Cardshark::PiquetDeck do
4
- #create a piquet deck
5
- before :all do
6
- @piquet = Cardshark::PiquetDeck.new
7
- end
8
-
9
- it 'should contain 32 cards' do
10
- @piquet.size.should == 32
11
- end
12
-
13
- end
@@ -1,47 +0,0 @@
1
- require 'cardshark/uno_deck'
2
-
3
- describe Cardshark::UnoDeck do
4
- #create a uno deck
5
- before :all do
6
- @uno = Cardshark::UnoDeck.new
7
- end
8
-
9
- it 'should contain 108 cards' do
10
- @uno.size.should == 108
11
- end
12
-
13
- it 'should contain one zero in each suit' do
14
- zeros = Hash.new
15
- Cardshark::UnoDeck::SUITS.each do |suit|
16
- zeros[suit] = 0
17
- end
18
- @uno.cards.each do |card|
19
- if card.rank == :zero then
20
- zeros[card.suit] += 1
21
- end
22
- end
23
- Cardshark::UnoDeck::SUITS.each do |suit|
24
- zeros[suit].should == 1
25
- end
26
- end
27
-
28
- it 'should contain two of each rank other than zero in each suit' do
29
- cards = Hash.new
30
- Cardshark::UnoDeck::RANKS.each do |rank|
31
- cards[rank] = Hash.new
32
- Cardshark::UnoDeck::SUITS.each do |suit|
33
- cards[rank][suit] = 0
34
- end
35
- end
36
- @uno.cards.each do |card|
37
- if Cardshark::UnoDeck::RANKS.include?(card.rank)
38
- cards[card.rank][card.suit] += 1
39
- end
40
- end
41
- Cardshark::UnoDeck::RANKS.each do |rank|
42
- Cardshark::UnoDeck::SUITS.each do |suit|
43
- cards[rank][suit].should == 2 unless rank == :zero
44
- end
45
- end
46
- end
47
- end