Решение на Четвърта задача от Милена Монова
Обратно към всички решения
Към профила на Милена Монова
Резултати
- 1 точка от тестове
- 1 отнета точка
- 0 точки общо
- 14 успешни тест(а)
- 43 неуспешни тест(а)
Код
Лог от изпълнението
...FF.FFFF.Ace of Spades
9 of Clubs
FF..FFF.FFFF.Ace of Spades
9 of Clubs
FFFFFFFFFFFFFFFFFFFFF.FFFF.Ace of Spades
9 of Clubs
FF.F..
Failures:
1) WarDeck behaves like a deck implements Enumerable
Failure/Error: expect(deck_class).to include(Enumerable)
expected WarDeck to include Enumerable
Diff:
@@ -1,2 +1,2 @@
-[Enumerable]
+WarDeck
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:140
# /tmp/d20151112-27349-1um7w3a/spec.rb:9:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) WarDeck behaves like a deck fills the deck if no initialize parameters are given
Failure/Error: expect(deck.to_a).to match_array all_available_cards
NoMethodError:
undefined method `to_a' for #<WarDeck:0x007f5600f58770>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:140
# /tmp/d20151112-27349-1um7w3a/spec.rb:18:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) WarDeck behaves like a deck #draw_top_card pops the top-most card
Failure/Error: expect(small_deck.to_a).to eq [nine_of_clubs]
NoMethodError:
undefined method `to_a' for #<WarDeck:0x007f5600f41700>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:140
# /tmp/d20151112-27349-1um7w3a/spec.rb:30:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) WarDeck behaves like a deck #draw_bottom_card pops the bottom-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades]
NoMethodError:
undefined method `to_a' for #<WarDeck:0x007f5600f2b4f0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:140
# /tmp/d20151112-27349-1um7w3a/spec.rb:37:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) WarDeck behaves like a deck #top peeks at the top-most card
Failure/Error: expect(small_deck.top_card).to eq ace_of_spades
NoMethodError:
undefined method `top_card' for #<WarDeck:0x007f5600f118c0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:140
# /tmp/d20151112-27349-1um7w3a/spec.rb:43:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) WarDeck behaves like a deck #bottom peeks at the bottom-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades, nine_of_clubs]
NoMethodError:
undefined method `to_a' for #<WarDeck:0x007f5600efe9a0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:140
# /tmp/d20151112-27349-1um7w3a/spec.rb:51:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) WarDeck behaves like a deck #to_s returns the names of the cards, each on its own line
Failure/Error: expect(small_deck.to_s.strip).to eq "Ace of Spades\n9 of Clubs"
NoMethodError:
undefined method `strip' for #<Array:0x007f5600ed8688>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:140
# /tmp/d20151112-27349-1um7w3a/spec.rb:68:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) WarDeck #sort sorts the cards in the defined order
Failure/Error: expect(deck.sort.to_a).to eq [jack_of_spades, ten_of_hearts, ace_of_clubs, two_of_clubs]
ArgumentError:
comparison of Array with Array failed
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort_by'
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort_by!'
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort'
# /tmp/d20151112-27349-1um7w3a/spec.rb:155:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) WarDeck hand #allow_face_up? returns true if the cards are less than or equal to 3
Failure/Error: expect(hand.allow_face_up?).to eq true
expected: true
got: false
(compared using ==)
# /tmp/d20151112-27349-1um7w3a/spec.rb:178:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) BeloteDeck behaves like a deck implements Enumerable
Failure/Error: expect(deck_class).to include(Enumerable)
expected BeloteDeck to include Enumerable
Diff:
@@ -1,2 +1,2 @@
-[Enumerable]
+BeloteDeck
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:191
# /tmp/d20151112-27349-1um7w3a/spec.rb:9:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
11) BeloteDeck behaves like a deck fills the deck if no initialize parameters are given
Failure/Error: expect(deck.to_a).to match_array all_available_cards
NoMethodError:
undefined method `to_a' for #<BeloteDeck:0x007f5600e31158>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:191
# /tmp/d20151112-27349-1um7w3a/spec.rb:18:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
12) BeloteDeck behaves like a deck #draw_top_card pops the top-most card
Failure/Error: expect(small_deck.to_a).to eq [nine_of_clubs]
NoMethodError:
undefined method `to_a' for #<BeloteDeck:0x007f5600e15c50>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:191
# /tmp/d20151112-27349-1um7w3a/spec.rb:30:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
13) BeloteDeck behaves like a deck #draw_bottom_card pops the bottom-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades]
NoMethodError:
undefined method `to_a' for #<BeloteDeck:0x007f5600e0a328>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:191
# /tmp/d20151112-27349-1um7w3a/spec.rb:37:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
14) BeloteDeck behaves like a deck #top peeks at the top-most card
Failure/Error: expect(small_deck.top_card).to eq ace_of_spades
NoMethodError:
undefined method `top_card' for #<BeloteDeck:0x007f5600e02d30>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:191
# /tmp/d20151112-27349-1um7w3a/spec.rb:43:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
15) BeloteDeck behaves like a deck #bottom peeks at the bottom-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades, nine_of_clubs]
NoMethodError:
undefined method `to_a' for #<BeloteDeck:0x007f5600e001c0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:191
# /tmp/d20151112-27349-1um7w3a/spec.rb:51:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
16) BeloteDeck behaves like a deck #to_s returns the names of the cards, each on its own line
Failure/Error: expect(small_deck.to_s.strip).to eq "Ace of Spades\n9 of Clubs"
NoMethodError:
undefined method `strip' for #<Array:0x007f5600dd4de0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:191
# /tmp/d20151112-27349-1um7w3a/spec.rb:68:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
17) BeloteDeck #sort sorts the cards in the defined order
Failure/Error: expect(deck.sort.to_a).to eq [jack_of_spades, ten_of_hearts, ace_of_clubs, seven_of_clubs]
ArgumentError:
comparison of Array with Array failed
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort_by'
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort_by!'
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort'
# /tmp/d20151112-27349-1um7w3a/spec.rb:206:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
18) BeloteDeck hand #deal deals 8 cards
Failure/Error: hand = BeloteDeck.new.deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600d9d908>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:213:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
19) BeloteDeck hand #highest_of_suit returns the strongest card of the specified suit
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600d965b8 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:230:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
20) BeloteDeck hand #belote? returns true if there is a king and a queen of the same suit
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600d6b598 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:249:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
21) BeloteDeck hand #belote? returns false when there is no king and queen of the same suit
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600d5ed70 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:264:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
22) BeloteDeck hand #tierce? with tierce returns true for cards with names
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600d4bc98 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:282:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
23) BeloteDeck hand #tierce? with tierce returns true for cards with numbers
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600d48cf0 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:297:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
24) BeloteDeck hand #tierce? without tierce does not confuse cards with different suits
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600ccd258 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:314:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
25) BeloteDeck hand #quarte? detects four cards with increasing ranks
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600c76160 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:332:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
26) BeloteDeck hand #quarte? does not return true if there is no quarte
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600b52a90 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:347:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
27) BeloteDeck hand #quint? detects five cards with increasing ranks
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600b25220 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:364:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
28) BeloteDeck hand #quint? does not return true if there is no quint
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600b16900 @deck=[]>
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:379:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
29) BeloteDeck hand #carre_of_jacks? behaves like carre-checking method returns true when there is a carre
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600b0f038 @deck=[]>
Shared Example Group: "carre-checking method" called from /tmp/d20151112-27349-1um7w3a/spec.rb:386
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:84:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
30) BeloteDeck hand #carre_of_jacks? behaves like carre-checking method returns false when there is no carre
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600b034e0 @deck=[]>
Shared Example Group: "carre-checking method" called from /tmp/d20151112-27349-1um7w3a/spec.rb:386
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:99:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
31) BeloteDeck hand #carre_of_nines? behaves like carre-checking method returns true when there is a carre
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600ad3f38 @deck=[]>
Shared Example Group: "carre-checking method" called from /tmp/d20151112-27349-1um7w3a/spec.rb:390
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:84:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
32) BeloteDeck hand #carre_of_nines? behaves like carre-checking method returns false when there is no carre
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600ac71e8 @deck=[]>
Shared Example Group: "carre-checking method" called from /tmp/d20151112-27349-1um7w3a/spec.rb:390
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:99:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
33) BeloteDeck hand #carre_of_aces? behaves like carre-checking method returns true when there is a carre
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600aa9c60 @deck=[]>
Shared Example Group: "carre-checking method" called from /tmp/d20151112-27349-1um7w3a/spec.rb:394
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:84:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
34) BeloteDeck hand #carre_of_aces? behaves like carre-checking method returns false when there is no carre
Failure/Error: ]).deal
NoMethodError:
undefined method `BeloteDeck' for #<BeloteDeck:0x007f5600a9e978 @deck=[]>
Shared Example Group: "carre-checking method" called from /tmp/d20151112-27349-1um7w3a/spec.rb:394
# /tmp/d20151112-27349-1um7w3a/solution.rb:158:in `deal'
# /tmp/d20151112-27349-1um7w3a/spec.rb:99:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
35) SixtySixDeck behaves like a deck implements Enumerable
Failure/Error: expect(deck_class).to include(Enumerable)
expected SixtySixDeck to include Enumerable
Diff:
@@ -1,2 +1,2 @@
-[Enumerable]
+SixtySixDeck
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:400
# /tmp/d20151112-27349-1um7w3a/spec.rb:9:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
36) SixtySixDeck behaves like a deck fills the deck if no initialize parameters are given
Failure/Error: expect(deck.to_a).to match_array all_available_cards
NoMethodError:
undefined method `to_a' for #<SixtySixDeck:0x007f5600a50ca0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:400
# /tmp/d20151112-27349-1um7w3a/spec.rb:18:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
37) SixtySixDeck behaves like a deck #draw_top_card pops the top-most card
Failure/Error: expect(small_deck.to_a).to eq [nine_of_clubs]
NoMethodError:
undefined method `to_a' for #<SixtySixDeck:0x007f5600a32570>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:400
# /tmp/d20151112-27349-1um7w3a/spec.rb:30:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
38) SixtySixDeck behaves like a deck #draw_bottom_card pops the bottom-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades]
NoMethodError:
undefined method `to_a' for #<SixtySixDeck:0x007f5600a06678>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:400
# /tmp/d20151112-27349-1um7w3a/spec.rb:37:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
39) SixtySixDeck behaves like a deck #top peeks at the top-most card
Failure/Error: expect(small_deck.top_card).to eq ace_of_spades
NoMethodError:
undefined method `top_card' for #<SixtySixDeck:0x007f56009e4a28>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:400
# /tmp/d20151112-27349-1um7w3a/spec.rb:43:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
40) SixtySixDeck behaves like a deck #bottom peeks at the bottom-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades, nine_of_clubs]
NoMethodError:
undefined method `to_a' for #<SixtySixDeck:0x007f5600991fa8>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:400
# /tmp/d20151112-27349-1um7w3a/spec.rb:51:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
41) SixtySixDeck behaves like a deck #to_s returns the names of the cards, each on its own line
Failure/Error: expect(small_deck.to_s.strip).to eq "Ace of Spades\n9 of Clubs"
NoMethodError:
undefined method `strip' for #<Array:0x007f5600983160>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-1um7w3a/spec.rb:400
# /tmp/d20151112-27349-1um7w3a/spec.rb:68:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
42) SixtySixDeck #sort sorts the cards in the defined order
Failure/Error: expect(deck.sort.to_a).to eq [jack_of_spades, ten_of_hearts, ace_of_clubs, two_of_clubs]
ArgumentError:
comparison of Array with Array failed
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort_by'
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort_by!'
# /tmp/d20151112-27349-1um7w3a/solution.rb:91:in `sort'
# /tmp/d20151112-27349-1um7w3a/spec.rb:415:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
43) SixtySixDeck hand #twenty? returns true for king and queen not of the trump suit
Failure/Error: expect(hand.twenty?(:hearts)).to be true
expected #<TrueClass:20> => true
got #<FalseClass:0> => false
Compared using equal?, which compares object identity,
but expected and actual are not the same object. Use
`expect(actual).to eq(expected)` if you don't care about
object identity in this example.
# /tmp/d20151112-27349-1um7w3a/spec.rb:439:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.04727 seconds
57 examples, 43 failures
Failed examples:
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:8 # WarDeck behaves like a deck implements Enumerable
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:14 # WarDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:28 # WarDeck behaves like a deck #draw_top_card pops the top-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:35 # WarDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:42 # WarDeck behaves like a deck #top peeks at the top-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:49 # WarDeck behaves like a deck #bottom peeks at the bottom-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:67 # WarDeck behaves like a deck #to_s returns the names of the cards, each on its own line
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:145 # WarDeck #sort sorts the cards in the defined order
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:175 # WarDeck hand #allow_face_up? returns true if the cards are less than or equal to 3
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:8 # BeloteDeck behaves like a deck implements Enumerable
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:14 # BeloteDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:28 # BeloteDeck behaves like a deck #draw_top_card pops the top-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:35 # BeloteDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:42 # BeloteDeck behaves like a deck #top peeks at the top-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:49 # BeloteDeck behaves like a deck #bottom peeks at the bottom-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:67 # BeloteDeck behaves like a deck #to_s returns the names of the cards, each on its own line
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:196 # BeloteDeck #sort sorts the cards in the defined order
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:212 # BeloteDeck hand #deal deals 8 cards
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:220 # BeloteDeck hand #highest_of_suit returns the strongest card of the specified suit
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:239 # BeloteDeck hand #belote? returns true if there is a king and a queen of the same suit
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:254 # BeloteDeck hand #belote? returns false when there is no king and queen of the same suit
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:272 # BeloteDeck hand #tierce? with tierce returns true for cards with names
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:287 # BeloteDeck hand #tierce? with tierce returns true for cards with numbers
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:304 # BeloteDeck hand #tierce? without tierce does not confuse cards with different suits
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:322 # BeloteDeck hand #quarte? detects four cards with increasing ranks
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:337 # BeloteDeck hand #quarte? does not return true if there is no quarte
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:354 # BeloteDeck hand #quint? detects five cards with increasing ranks
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:369 # BeloteDeck hand #quint? does not return true if there is no quint
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:74 # BeloteDeck hand #carre_of_jacks? behaves like carre-checking method returns true when there is a carre
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:89 # BeloteDeck hand #carre_of_jacks? behaves like carre-checking method returns false when there is no carre
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:74 # BeloteDeck hand #carre_of_nines? behaves like carre-checking method returns true when there is a carre
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:89 # BeloteDeck hand #carre_of_nines? behaves like carre-checking method returns false when there is no carre
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:74 # BeloteDeck hand #carre_of_aces? behaves like carre-checking method returns true when there is a carre
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:89 # BeloteDeck hand #carre_of_aces? behaves like carre-checking method returns false when there is no carre
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:8 # SixtySixDeck behaves like a deck implements Enumerable
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:14 # SixtySixDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:28 # SixtySixDeck behaves like a deck #draw_top_card pops the top-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:35 # SixtySixDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:42 # SixtySixDeck behaves like a deck #top peeks at the top-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:49 # SixtySixDeck behaves like a deck #bottom peeks at the bottom-most card
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:67 # SixtySixDeck behaves like a deck #to_s returns the names of the cards, each on its own line
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:405 # SixtySixDeck #sort sorts the cards in the defined order
rspec /tmp/d20151112-27349-1um7w3a/spec.rb:429 # SixtySixDeck hand #twenty? returns true for king and queen not of the trump suit
История (1 версия и 1 коментар)
Милена обнови решението на 11.11.2015 16:25 (преди около 9 години)