Решение на Четвърта задача от Милена Дренска
Обратно към всички решения
Към профила на Милена Дренска
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 39 успешни тест(а)
- 18 неуспешни тест(а)
Код
Лог от изпълнението
..F.FF.F...FF....FF.F...FF.F..F.............FF.F...FF....
Failures:
1) Card #== compares two cards by their rank and suit
Failure/Error: expect(Card.new(4, :spades)).to eq Card.new(4, :spades)
expected: #<Card:0x007fee2ebfa800 @rank=4, @suit=:spades>
got: #<Card:0x007fee2ebfa968 @rank=4, @suit=:spades>
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-#<Card:0x007fee2ebfa800 @rank=4, @suit=:spades>
+#<Card:0x007fee2ebfa968 @rank=4, @suit=:spades>
# /tmp/d20151112-27349-pedzkr/spec.rb:131: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)>'
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
expected collection contained: [#<Card:0x007fee2fa43cb8 @rank=2, @suit=:clubs>, #<Card:0x007fee2fa43c90 @rank=3, @suit=:clubs>, #<Card:0x007fee2fa43c68 @rank=4, @suit=:clubs>, #<Card:0x007fee2fa43c40 @rank=5, @suit=:clubs>, #<Card:0x007fee2fa43c18 @rank=6, @suit=:clubs>, #<Card:0x007fee2fa43bf0 @rank=7, @suit=:clubs>, #<Card:0x007fee2fa43bc8 @rank=8, @suit=:clubs>, #<Card:0x007fee2fa43b78 @rank=9, @suit=:clubs>, #<Card:0x007fee2fa43b50 @rank=10, @suit=:clubs>, #<Card:0x007fee2fa43b28 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2fa43b00 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2fa43ad8 @rank=:king, @suit=:clubs>, #<Card:0x007fee2fa43ab0 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2fa43a88 @rank=2, @suit=:diamonds>, #<Card:0x007fee2fa43a60 @rank=3, @suit=:diamonds>, #<Card:0x007fee2fa43a38 @rank=4, @suit=:diamonds>, #<Card:0x007fee2fa43a10 @rank=5, @suit=:diamonds>, #<Card:0x007fee2fa439e8 @rank=6, @suit=:diamonds>, #<Card:0x007fee2fa439c0 @rank=7, @suit=:diamonds>, #<Card:0x007fee2fa43998 @rank=8, @suit=:diamonds>, #<Card:0x007fee2fa43970 @rank=9, @suit=:diamonds>, #<Card:0x007fee2fa43948 @rank=10, @suit=:diamonds>, #<Card:0x007fee2fa43920 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2fa438f8 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2fa438d0 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2fa438a8 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2fa43880 @rank=2, @suit=:hearts>, #<Card:0x007fee2fa43858 @rank=3, @suit=:hearts>, #<Card:0x007fee2fa43830 @rank=4, @suit=:hearts>, #<Card:0x007fee2fa43808 @rank=5, @suit=:hearts>, #<Card:0x007fee2fa437e0 @rank=6, @suit=:hearts>, #<Card:0x007fee2fa437b8 @rank=7, @suit=:hearts>, #<Card:0x007fee2fa43790 @rank=8, @suit=:hearts>, #<Card:0x007fee2fa43768 @rank=9, @suit=:hearts>, #<Card:0x007fee2fa43740 @rank=10, @suit=:hearts>, #<Card:0x007fee2fa43718 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2fa436f0 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2fa436c8 @rank=:king, @suit=:hearts>, #<Card:0x007fee2fa436a0 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2fa43678 @rank=2, @suit=:spades>, #<Card:0x007fee2fa43650 @rank=3, @suit=:spades>, #<Card:0x007fee2fa43628 @rank=4, @suit=:spades>, #<Card:0x007fee2fa43600 @rank=5, @suit=:spades>, #<Card:0x007fee2fa435d8 @rank=6, @suit=:spades>, #<Card:0x007fee2fa435b0 @rank=7, @suit=:spades>, #<Card:0x007fee2fa43588 @rank=8, @suit=:spades>, #<Card:0x007fee2fa43560 @rank=9, @suit=:spades>, #<Card:0x007fee2fa43538 @rank=10, @suit=:spades>, #<Card:0x007fee2fa43510 @rank=:jack, @suit=:spades>, #<Card:0x007fee2fa434e8 @rank=:queen, @suit=:spades>, #<Card:0x007fee2fa434c0 @rank=:king, @suit=:spades>, #<Card:0x007fee2fa43498 @rank=:ace, @suit=:spades>]
actual collection contained: [#<Card:0x007fee2f9dd008 @rank=2, @suit=:spades>, #<Card:0x007fee2f9dcfe0 @rank=2, @suit=:hearts>, #<Card:0x007fee2f9dcfb8 @rank=2, @suit=:diamonds>, #<Card:0x007fee2f9dcf90 @rank=2, @suit=:clubs>, #<Card:0x007fee2f9dcf68 @rank=3, @suit=:spades>, #<Card:0x007fee2f9dcf18 @rank=3, @suit=:hearts>, #<Card:0x007fee2f9dcef0 @rank=3, @suit=:diamonds>, #<Card:0x007fee2f9dcec8 @rank=3, @suit=:clubs>, #<Card:0x007fee2f9dcea0 @rank=4, @suit=:spades>, #<Card:0x007fee2f9dce78 @rank=4, @suit=:hearts>, #<Card:0x007fee2f9dce50 @rank=4, @suit=:diamonds>, #<Card:0x007fee2f9dcdd8 @rank=4, @suit=:clubs>, #<Card:0x007fee2f9dcdb0 @rank=5, @suit=:spades>, #<Card:0x007fee2f9dcd88 @rank=5, @suit=:hearts>, #<Card:0x007fee2f9dcd38 @rank=5, @suit=:diamonds>, #<Card:0x007fee2f9dcce8 @rank=5, @suit=:clubs>, #<Card:0x007fee2f9dccc0 @rank=6, @suit=:spades>, #<Card:0x007fee2f9dcc98 @rank=6, @suit=:hearts>, #<Card:0x007fee2f9dcc70 @rank=6, @suit=:diamonds>, #<Card:0x007fee2f9dcc48 @rank=6, @suit=:clubs>, #<Card:0x007fee2f9dcc20 @rank=7, @suit=:spades>, #<Card:0x007fee2f9dcbd0 @rank=7, @suit=:hearts>, #<Card:0x007fee2f9dcba8 @rank=7, @suit=:diamonds>, #<Card:0x007fee2f9dcb80 @rank=7, @suit=:clubs>, #<Card:0x007fee2f9dcb58 @rank=8, @suit=:spades>, #<Card:0x007fee2f9dcb30 @rank=8, @suit=:hearts>, #<Card:0x007fee2f9dcb08 @rank=8, @suit=:diamonds>, #<Card:0x007fee2f9dcae0 @rank=8, @suit=:clubs>, #<Card:0x007fee2f9dca90 @rank=9, @suit=:spades>, #<Card:0x007fee2f9dca68 @rank=9, @suit=:hearts>, #<Card:0x007fee2f9dca40 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f9dca18 @rank=9, @suit=:clubs>, #<Card:0x007fee2f9dc9f0 @rank=10, @suit=:spades>, #<Card:0x007fee2f9dc9c8 @rank=10, @suit=:hearts>, #<Card:0x007fee2f9dc978 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f9dc950 @rank=10, @suit=:clubs>, #<Card:0x007fee2f9dc928 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f9dc900 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f9dc8d8 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f9dc8b0 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f9dc860 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f9dc838 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f9dc810 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f9dc7e8 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f9dc7c0 @rank=:king, @suit=:spades>, #<Card:0x007fee2f9dc798 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f9dc770 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f9dc720 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f9dc6f8 @rank=:ace, @suit=:spades>, #<Card:0x007fee2f9dc6a8 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f9dc680 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f9dc658 @rank=:ace, @suit=:clubs>]
the missing elements were: [#<Card:0x007fee2fa43cb8 @rank=2, @suit=:clubs>, #<Card:0x007fee2fa43c90 @rank=3, @suit=:clubs>, #<Card:0x007fee2fa43c68 @rank=4, @suit=:clubs>, #<Card:0x007fee2fa43c40 @rank=5, @suit=:clubs>, #<Card:0x007fee2fa43c18 @rank=6, @suit=:clubs>, #<Card:0x007fee2fa43bf0 @rank=7, @suit=:clubs>, #<Card:0x007fee2fa43bc8 @rank=8, @suit=:clubs>, #<Card:0x007fee2fa43b78 @rank=9, @suit=:clubs>, #<Card:0x007fee2fa43b50 @rank=10, @suit=:clubs>, #<Card:0x007fee2fa43b28 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2fa43b00 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2fa43ad8 @rank=:king, @suit=:clubs>, #<Card:0x007fee2fa43ab0 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2fa43a88 @rank=2, @suit=:diamonds>, #<Card:0x007fee2fa43a60 @rank=3, @suit=:diamonds>, #<Card:0x007fee2fa43a38 @rank=4, @suit=:diamonds>, #<Card:0x007fee2fa43a10 @rank=5, @suit=:diamonds>, #<Card:0x007fee2fa439e8 @rank=6, @suit=:diamonds>, #<Card:0x007fee2fa439c0 @rank=7, @suit=:diamonds>, #<Card:0x007fee2fa43998 @rank=8, @suit=:diamonds>, #<Card:0x007fee2fa43970 @rank=9, @suit=:diamonds>, #<Card:0x007fee2fa43948 @rank=10, @suit=:diamonds>, #<Card:0x007fee2fa43920 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2fa438f8 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2fa438d0 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2fa438a8 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2fa43880 @rank=2, @suit=:hearts>, #<Card:0x007fee2fa43858 @rank=3, @suit=:hearts>, #<Card:0x007fee2fa43830 @rank=4, @suit=:hearts>, #<Card:0x007fee2fa43808 @rank=5, @suit=:hearts>, #<Card:0x007fee2fa437e0 @rank=6, @suit=:hearts>, #<Card:0x007fee2fa437b8 @rank=7, @suit=:hearts>, #<Card:0x007fee2fa43790 @rank=8, @suit=:hearts>, #<Card:0x007fee2fa43768 @rank=9, @suit=:hearts>, #<Card:0x007fee2fa43740 @rank=10, @suit=:hearts>, #<Card:0x007fee2fa43718 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2fa436f0 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2fa436c8 @rank=:king, @suit=:hearts>, #<Card:0x007fee2fa436a0 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2fa43678 @rank=2, @suit=:spades>, #<Card:0x007fee2fa43650 @rank=3, @suit=:spades>, #<Card:0x007fee2fa43628 @rank=4, @suit=:spades>, #<Card:0x007fee2fa43600 @rank=5, @suit=:spades>, #<Card:0x007fee2fa435d8 @rank=6, @suit=:spades>, #<Card:0x007fee2fa435b0 @rank=7, @suit=:spades>, #<Card:0x007fee2fa43588 @rank=8, @suit=:spades>, #<Card:0x007fee2fa43560 @rank=9, @suit=:spades>, #<Card:0x007fee2fa43538 @rank=10, @suit=:spades>, #<Card:0x007fee2fa43510 @rank=:jack, @suit=:spades>, #<Card:0x007fee2fa434e8 @rank=:queen, @suit=:spades>, #<Card:0x007fee2fa434c0 @rank=:king, @suit=:spades>, #<Card:0x007fee2fa43498 @rank=:ace, @suit=:spades>]
the extra elements were: [#<Card:0x007fee2f9dd008 @rank=2, @suit=:spades>, #<Card:0x007fee2f9dcfe0 @rank=2, @suit=:hearts>, #<Card:0x007fee2f9dcfb8 @rank=2, @suit=:diamonds>, #<Card:0x007fee2f9dcf90 @rank=2, @suit=:clubs>, #<Card:0x007fee2f9dcf68 @rank=3, @suit=:spades>, #<Card:0x007fee2f9dcf18 @rank=3, @suit=:hearts>, #<Card:0x007fee2f9dcef0 @rank=3, @suit=:diamonds>, #<Card:0x007fee2f9dcec8 @rank=3, @suit=:clubs>, #<Card:0x007fee2f9dcea0 @rank=4, @suit=:spades>, #<Card:0x007fee2f9dce78 @rank=4, @suit=:hearts>, #<Card:0x007fee2f9dce50 @rank=4, @suit=:diamonds>, #<Card:0x007fee2f9dcdd8 @rank=4, @suit=:clubs>, #<Card:0x007fee2f9dcdb0 @rank=5, @suit=:spades>, #<Card:0x007fee2f9dcd88 @rank=5, @suit=:hearts>, #<Card:0x007fee2f9dcd38 @rank=5, @suit=:diamonds>, #<Card:0x007fee2f9dcce8 @rank=5, @suit=:clubs>, #<Card:0x007fee2f9dccc0 @rank=6, @suit=:spades>, #<Card:0x007fee2f9dcc98 @rank=6, @suit=:hearts>, #<Card:0x007fee2f9dcc70 @rank=6, @suit=:diamonds>, #<Card:0x007fee2f9dcc48 @rank=6, @suit=:clubs>, #<Card:0x007fee2f9dcc20 @rank=7, @suit=:spades>, #<Card:0x007fee2f9dcbd0 @rank=7, @suit=:hearts>, #<Card:0x007fee2f9dcba8 @rank=7, @suit=:diamonds>, #<Card:0x007fee2f9dcb80 @rank=7, @suit=:clubs>, #<Card:0x007fee2f9dcb58 @rank=8, @suit=:spades>, #<Card:0x007fee2f9dcb30 @rank=8, @suit=:hearts>, #<Card:0x007fee2f9dcb08 @rank=8, @suit=:diamonds>, #<Card:0x007fee2f9dcae0 @rank=8, @suit=:clubs>, #<Card:0x007fee2f9dca90 @rank=9, @suit=:spades>, #<Card:0x007fee2f9dca68 @rank=9, @suit=:hearts>, #<Card:0x007fee2f9dca40 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f9dca18 @rank=9, @suit=:clubs>, #<Card:0x007fee2f9dc9f0 @rank=10, @suit=:spades>, #<Card:0x007fee2f9dc9c8 @rank=10, @suit=:hearts>, #<Card:0x007fee2f9dc978 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f9dc950 @rank=10, @suit=:clubs>, #<Card:0x007fee2f9dc928 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f9dc900 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f9dc8d8 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f9dc8b0 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f9dc860 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f9dc838 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f9dc810 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f9dc7e8 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f9dc7c0 @rank=:king, @suit=:spades>, #<Card:0x007fee2f9dc798 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f9dc770 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f9dc720 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f9dc6f8 @rank=:ace, @suit=:spades>, #<Card:0x007fee2f9dc6a8 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f9dc680 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f9dc658 @rank=:ace, @suit=:clubs>]
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:140
# /tmp/d20151112-27349-pedzkr/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 #size returns the size of the deck
Failure/Error: expect(small_deck.size).to eq 2
expected: 2
got: 52
(compared using ==)
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:140
# /tmp/d20151112-27349-pedzkr/spec.rb:23: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.draw_bottom_card).to eq nine_of_clubs
expected: #<Card:0x007fee2f97e170 @rank=9, @suit=:clubs>
got: #<Card:0x007fee2f97e198 @rank=:ace, @suit=:spades>
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-#<Card:0x007fee2f97e170 @rank=9, @suit=:clubs>
+#<Card:0x007fee2f97e198 @rank=:ace, @suit=:spades>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:140
# /tmp/d20151112-27349-pedzkr/spec.rb:36: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 #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:0x007fee2fa3fe88>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:140
# /tmp/d20151112-27349-pedzkr/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)>'
6) 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]
expected: [#<Card:0x007fee2fa3d7c8 @rank=:jack, @suit=:spades>, #<Card:0x007fee2fa3d778 @rank=10, @suit=:hearts>, #<Card:0x007fee2fa3d7f0 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2fa3d7a0 @rank=2, @suit=:clubs>]
got: [#<Card:0x007fee2fa3d7f0 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2fa3d7c8 @rank=:jack, @suit=:spades>, #<Card:0x007fee2fa3d778 @rank=10, @suit=:hearts>, #<Card:0x007fee2fa3d7a0 @rank=2, @suit=:clubs>]
(compared using ==)
Diff:
@@ -1,5 +1,5 @@
-[#<Card:0x007fee2fa3d7c8 @rank=:jack, @suit=:spades>,
+[#<Card:0x007fee2fa3d7f0 @rank=:ace, @suit=:clubs>,
+ #<Card:0x007fee2fa3d7c8 @rank=:jack, @suit=:spades>,
#<Card:0x007fee2fa3d778 @rank=10, @suit=:hearts>,
- #<Card:0x007fee2fa3d7f0 @rank=:ace, @suit=:clubs>,
#<Card:0x007fee2fa3d7a0 @rank=2, @suit=:clubs>]
# /tmp/d20151112-27349-pedzkr/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)>'
7) 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
expected collection contained: [#<Card:0x007fee2f988058 @rank=7, @suit=:clubs>, #<Card:0x007fee2f98bac8 @rank=8, @suit=:clubs>, #<Card:0x007fee2f96acd8 @rank=9, @suit=:clubs>, #<Card:0x007fee2f96acb0 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f96ac10 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f96abe8 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f96ab98 @rank=10, @suit=:clubs>, #<Card:0x007fee2f96ab70 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2f96aaf8 @rank=7, @suit=:diamonds>, #<Card:0x007fee2f96aad0 @rank=8, @suit=:diamonds>, #<Card:0x007fee2f96aa80 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f96aa58 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f96aa30 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f96aa08 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f96a9b8 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f96a990 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f96a8f0 @rank=7, @suit=:hearts>, #<Card:0x007fee2f96a8a0 @rank=8, @suit=:hearts>, #<Card:0x007fee2f96a878 @rank=9, @suit=:hearts>, #<Card:0x007fee2f96a800 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f96a7d8 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f96a788 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f96a6e8 @rank=10, @suit=:hearts>, #<Card:0x007fee2f96a6c0 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f96a698 @rank=7, @suit=:spades>, #<Card:0x007fee2f96a648 @rank=8, @suit=:spades>, #<Card:0x007fee2f96a620 @rank=9, @suit=:spades>, #<Card:0x007fee2f96a5a8 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f96a580 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f96a530 @rank=:king, @suit=:spades>, #<Card:0x007fee2f96a508 @rank=10, @suit=:spades>, #<Card:0x007fee2f96a4e0 @rank=:ace, @suit=:spades>]
actual collection contained: [#<Card:0x007fee2f98afb0 @rank=7, @suit=:spades>, #<Card:0x007fee2f98af88 @rank=7, @suit=:hearts>, #<Card:0x007fee2f98af60 @rank=7, @suit=:diamonds>, #<Card:0x007fee2f98af38 @rank=7, @suit=:clubs>, #<Card:0x007fee2f98af10 @rank=8, @suit=:spades>, #<Card:0x007fee2f98aee8 @rank=8, @suit=:hearts>, #<Card:0x007fee2f98aec0 @rank=8, @suit=:diamonds>, #<Card:0x007fee2f98ae98 @rank=8, @suit=:clubs>, #<Card:0x007fee2f98ae70 @rank=9, @suit=:spades>, #<Card:0x007fee2f98ae48 @rank=9, @suit=:hearts>, #<Card:0x007fee2f98ae20 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f98adf8 @rank=9, @suit=:clubs>, #<Card:0x007fee2f98add0 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f98ada8 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f98ad80 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f98a970 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f98a790 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f989390 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f989318 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f9892c8 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f989250 @rank=:king, @suit=:spades>, #<Card:0x007fee2f989228 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f9891b0 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f989188 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f989160 @rank=10, @suit=:spades>, #<Card:0x007fee2f989110 @rank=10, @suit=:hearts>, #<Card:0x007fee2f989048 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f988fd0 @rank=10, @suit=:clubs>, #<Card:0x007fee2f988fa8 @rank=:ace, @suit=:spades>, #<Card:0x007fee2f988f30 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f988eb8 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f988e90 @rank=:ace, @suit=:clubs>]
the missing elements were: [#<Card:0x007fee2f988058 @rank=7, @suit=:clubs>, #<Card:0x007fee2f98bac8 @rank=8, @suit=:clubs>, #<Card:0x007fee2f96acd8 @rank=9, @suit=:clubs>, #<Card:0x007fee2f96acb0 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f96ac10 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f96abe8 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f96ab98 @rank=10, @suit=:clubs>, #<Card:0x007fee2f96ab70 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2f96aaf8 @rank=7, @suit=:diamonds>, #<Card:0x007fee2f96aad0 @rank=8, @suit=:diamonds>, #<Card:0x007fee2f96aa80 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f96aa58 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f96aa30 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f96aa08 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f96a9b8 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f96a990 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f96a8f0 @rank=7, @suit=:hearts>, #<Card:0x007fee2f96a8a0 @rank=8, @suit=:hearts>, #<Card:0x007fee2f96a878 @rank=9, @suit=:hearts>, #<Card:0x007fee2f96a800 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f96a7d8 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f96a788 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f96a6e8 @rank=10, @suit=:hearts>, #<Card:0x007fee2f96a6c0 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f96a698 @rank=7, @suit=:spades>, #<Card:0x007fee2f96a648 @rank=8, @suit=:spades>, #<Card:0x007fee2f96a620 @rank=9, @suit=:spades>, #<Card:0x007fee2f96a5a8 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f96a580 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f96a530 @rank=:king, @suit=:spades>, #<Card:0x007fee2f96a508 @rank=10, @suit=:spades>, #<Card:0x007fee2f96a4e0 @rank=:ace, @suit=:spades>]
the extra elements were: [#<Card:0x007fee2f98afb0 @rank=7, @suit=:spades>, #<Card:0x007fee2f98af88 @rank=7, @suit=:hearts>, #<Card:0x007fee2f98af60 @rank=7, @suit=:diamonds>, #<Card:0x007fee2f98af38 @rank=7, @suit=:clubs>, #<Card:0x007fee2f98af10 @rank=8, @suit=:spades>, #<Card:0x007fee2f98aee8 @rank=8, @suit=:hearts>, #<Card:0x007fee2f98aec0 @rank=8, @suit=:diamonds>, #<Card:0x007fee2f98ae98 @rank=8, @suit=:clubs>, #<Card:0x007fee2f98ae70 @rank=9, @suit=:spades>, #<Card:0x007fee2f98ae48 @rank=9, @suit=:hearts>, #<Card:0x007fee2f98ae20 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f98adf8 @rank=9, @suit=:clubs>, #<Card:0x007fee2f98add0 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f98ada8 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f98ad80 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f98a970 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f98a790 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f989390 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f989318 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f9892c8 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f989250 @rank=:king, @suit=:spades>, #<Card:0x007fee2f989228 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f9891b0 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f989188 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f989160 @rank=10, @suit=:spades>, #<Card:0x007fee2f989110 @rank=10, @suit=:hearts>, #<Card:0x007fee2f989048 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f988fd0 @rank=10, @suit=:clubs>, #<Card:0x007fee2f988fa8 @rank=:ace, @suit=:spades>, #<Card:0x007fee2f988f30 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f988eb8 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f988e90 @rank=:ace, @suit=:clubs>]
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:191
# /tmp/d20151112-27349-pedzkr/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)>'
8) BeloteDeck behaves like a deck #size returns the size of the deck
Failure/Error: expect(small_deck.size).to eq 2
expected: 2
got: 32
(compared using ==)
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:191
# /tmp/d20151112-27349-pedzkr/spec.rb:23: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) BeloteDeck behaves like a deck #draw_bottom_card pops the bottom-most card
Failure/Error: expect(small_deck.draw_bottom_card).to eq nine_of_clubs
expected: #<Card:0x007fee2f90d808 @rank=9, @suit=:clubs>
got: #<Card:0x007fee2f90d830 @rank=:ace, @suit=:spades>
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-#<Card:0x007fee2f90d808 @rank=9, @suit=:clubs>
+#<Card:0x007fee2f90d830 @rank=:ace, @suit=:spades>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:191
# /tmp/d20151112-27349-pedzkr/spec.rb:36: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)>'
10) 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:0x007fee2f8b9cd0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:191
# /tmp/d20151112-27349-pedzkr/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)>'
11) 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]
expected: [#<Card:0x007fee2f8a9b78 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f8a9b28 @rank=10, @suit=:hearts>, #<Card:0x007fee2f8a9c18 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2f8a9b50 @rank=7, @suit=:clubs>]
got: [#<Card:0x007fee2f8a9c18 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2f8a9b78 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f8a9b28 @rank=10, @suit=:hearts>, #<Card:0x007fee2f8a9b50 @rank=7, @suit=:clubs>]
(compared using ==)
Diff:
@@ -1,5 +1,5 @@
-[#<Card:0x007fee2f8a9b78 @rank=:jack, @suit=:spades>,
+[#<Card:0x007fee2f8a9c18 @rank=:ace, @suit=:clubs>,
+ #<Card:0x007fee2f8a9b78 @rank=:jack, @suit=:spades>,
#<Card:0x007fee2f8a9b28 @rank=10, @suit=:hearts>,
- #<Card:0x007fee2f8a9c18 @rank=:ace, @suit=:clubs>,
#<Card:0x007fee2f8a9b50 @rank=7, @suit=:clubs>]
# /tmp/d20151112-27349-pedzkr/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)>'
12) BeloteDeck hand #highest_of_suit returns the strongest card of the specified suit
Failure/Error: expect(hand.highest_of_suit(:clubs)).to eq Card.new(:ace, :clubs)
ArgumentError:
comparison of Card with Card failed
# /tmp/d20151112-27349-pedzkr/solution.rb:129:in `sort'
# /tmp/d20151112-27349-pedzkr/solution.rb:129:in `highest_of_suit'
# /tmp/d20151112-27349-pedzkr/spec.rb:232: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)>'
13) BeloteDeck hand #tierce? with tierce returns true for cards with names
Failure/Error: expect(hand.tierce?).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-pedzkr/spec.rb:284: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)>'
14) 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
expected collection contained: [#<Card:0x007fee2f43d3a0 @rank=9, @suit=:clubs>, #<Card:0x007fee2f43d378 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f43d328 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f43d2b0 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f43d238 @rank=10, @suit=:clubs>, #<Card:0x007fee2f43d210 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2f43d170 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f43d0d0 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f43d0a8 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f43d080 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f43d030 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f43d008 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f43cfe0 @rank=9, @suit=:hearts>, #<Card:0x007fee2f43cfb8 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f43ce50 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f43cdd8 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f43cd88 @rank=10, @suit=:hearts>, #<Card:0x007fee2f43cd10 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f43cce8 @rank=9, @suit=:spades>, #<Card:0x007fee2f43cc48 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f43cbd0 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f43cb80 @rank=:king, @suit=:spades>, #<Card:0x007fee2f43cae0 @rank=10, @suit=:spades>, #<Card:0x007fee2f43ca90 @rank=:ace, @suit=:spades>]
actual collection contained: [#<Card:0x007fee2f43e430 @rank=9, @suit=:spades>, #<Card:0x007fee2f43e408 @rank=9, @suit=:hearts>, #<Card:0x007fee2f43e368 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f43e340 @rank=9, @suit=:clubs>, #<Card:0x007fee2f43e318 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f43e2c8 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f43e2a0 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f43e278 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f43e250 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f43e200 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f43e1b0 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f43e188 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f43e160 @rank=:king, @suit=:spades>, #<Card:0x007fee2f43e138 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f43e0e8 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f43e0c0 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f43e098 @rank=10, @suit=:spades>, #<Card:0x007fee2f43e020 @rank=10, @suit=:hearts>, #<Card:0x007fee2f43dff8 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f43dfd0 @rank=10, @suit=:clubs>, #<Card:0x007fee2f43df58 @rank=:ace, @suit=:spades>, #<Card:0x007fee2f43df30 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f43df08 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f43de90 @rank=:ace, @suit=:clubs>]
the missing elements were: [#<Card:0x007fee2f43d3a0 @rank=9, @suit=:clubs>, #<Card:0x007fee2f43d378 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f43d328 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f43d2b0 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f43d238 @rank=10, @suit=:clubs>, #<Card:0x007fee2f43d210 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2f43d170 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f43d0d0 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f43d0a8 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f43d080 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f43d030 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f43d008 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f43cfe0 @rank=9, @suit=:hearts>, #<Card:0x007fee2f43cfb8 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f43ce50 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f43cdd8 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f43cd88 @rank=10, @suit=:hearts>, #<Card:0x007fee2f43cd10 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f43cce8 @rank=9, @suit=:spades>, #<Card:0x007fee2f43cc48 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f43cbd0 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f43cb80 @rank=:king, @suit=:spades>, #<Card:0x007fee2f43cae0 @rank=10, @suit=:spades>, #<Card:0x007fee2f43ca90 @rank=:ace, @suit=:spades>]
the extra elements were: [#<Card:0x007fee2f43e430 @rank=9, @suit=:spades>, #<Card:0x007fee2f43e408 @rank=9, @suit=:hearts>, #<Card:0x007fee2f43e368 @rank=9, @suit=:diamonds>, #<Card:0x007fee2f43e340 @rank=9, @suit=:clubs>, #<Card:0x007fee2f43e318 @rank=:jack, @suit=:spades>, #<Card:0x007fee2f43e2c8 @rank=:jack, @suit=:hearts>, #<Card:0x007fee2f43e2a0 @rank=:jack, @suit=:diamonds>, #<Card:0x007fee2f43e278 @rank=:jack, @suit=:clubs>, #<Card:0x007fee2f43e250 @rank=:queen, @suit=:spades>, #<Card:0x007fee2f43e200 @rank=:queen, @suit=:hearts>, #<Card:0x007fee2f43e1b0 @rank=:queen, @suit=:diamonds>, #<Card:0x007fee2f43e188 @rank=:queen, @suit=:clubs>, #<Card:0x007fee2f43e160 @rank=:king, @suit=:spades>, #<Card:0x007fee2f43e138 @rank=:king, @suit=:hearts>, #<Card:0x007fee2f43e0e8 @rank=:king, @suit=:diamonds>, #<Card:0x007fee2f43e0c0 @rank=:king, @suit=:clubs>, #<Card:0x007fee2f43e098 @rank=10, @suit=:spades>, #<Card:0x007fee2f43e020 @rank=10, @suit=:hearts>, #<Card:0x007fee2f43dff8 @rank=10, @suit=:diamonds>, #<Card:0x007fee2f43dfd0 @rank=10, @suit=:clubs>, #<Card:0x007fee2f43df58 @rank=:ace, @suit=:spades>, #<Card:0x007fee2f43df30 @rank=:ace, @suit=:hearts>, #<Card:0x007fee2f43df08 @rank=:ace, @suit=:diamonds>, #<Card:0x007fee2f43de90 @rank=:ace, @suit=:clubs>]
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:400
# /tmp/d20151112-27349-pedzkr/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)>'
15) SixtySixDeck behaves like a deck #size returns the size of the deck
Failure/Error: expect(small_deck.size).to eq 2
expected: 2
got: 24
(compared using ==)
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:400
# /tmp/d20151112-27349-pedzkr/spec.rb:23: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) SixtySixDeck behaves like a deck #draw_bottom_card pops the bottom-most card
Failure/Error: expect(small_deck.draw_bottom_card).to eq nine_of_clubs
expected: #<Card:0x007fee2f3a95d8 @rank=9, @suit=:clubs>
got: #<Card:0x007fee2f3a9600 @rank=:ace, @suit=:spades>
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-#<Card:0x007fee2f3a95d8 @rank=9, @suit=:clubs>
+#<Card:0x007fee2f3a9600 @rank=:ace, @suit=:spades>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:400
# /tmp/d20151112-27349-pedzkr/spec.rb:36: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) 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:0x007fee2edeaf70>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-pedzkr/spec.rb:400
# /tmp/d20151112-27349-pedzkr/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)>'
18) 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]
expected: [#<Card:0x007fee2edc04f0 @rank=:jack, @suit=:spades>, #<Card:0x007fee2edc04a0 @rank=10, @suit=:hearts>, #<Card:0x007fee2edc0518 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2edc04c8 @rank=9, @suit=:clubs>]
got: [#<Card:0x007fee2edc0518 @rank=:ace, @suit=:clubs>, #<Card:0x007fee2edc04f0 @rank=:jack, @suit=:spades>, #<Card:0x007fee2edc04a0 @rank=10, @suit=:hearts>, #<Card:0x007fee2edc04c8 @rank=9, @suit=:clubs>]
(compared using ==)
Diff:
@@ -1,5 +1,5 @@
-[#<Card:0x007fee2edc04f0 @rank=:jack, @suit=:spades>,
+[#<Card:0x007fee2edc0518 @rank=:ace, @suit=:clubs>,
+ #<Card:0x007fee2edc04f0 @rank=:jack, @suit=:spades>,
#<Card:0x007fee2edc04a0 @rank=10, @suit=:hearts>,
- #<Card:0x007fee2edc0518 @rank=:ace, @suit=:clubs>,
#<Card:0x007fee2edc04c8 @rank=9, @suit=:clubs>]
# /tmp/d20151112-27349-pedzkr/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)>'
Finished in 0.05248 seconds
57 examples, 18 failures
Failed examples:
rspec /tmp/d20151112-27349-pedzkr/spec.rb:130 # Card #== compares two cards by their rank and suit
rspec /tmp/d20151112-27349-pedzkr/spec.rb:14 # WarDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-pedzkr/spec.rb:22 # WarDeck behaves like a deck #size returns the size of the deck
rspec /tmp/d20151112-27349-pedzkr/spec.rb:35 # WarDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-pedzkr/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-pedzkr/spec.rb:145 # WarDeck #sort sorts the cards in the defined order
rspec /tmp/d20151112-27349-pedzkr/spec.rb:14 # BeloteDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-pedzkr/spec.rb:22 # BeloteDeck behaves like a deck #size returns the size of the deck
rspec /tmp/d20151112-27349-pedzkr/spec.rb:35 # BeloteDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-pedzkr/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-pedzkr/spec.rb:196 # BeloteDeck #sort sorts the cards in the defined order
rspec /tmp/d20151112-27349-pedzkr/spec.rb:220 # BeloteDeck hand #highest_of_suit returns the strongest card of the specified suit
rspec /tmp/d20151112-27349-pedzkr/spec.rb:272 # BeloteDeck hand #tierce? with tierce returns true for cards with names
rspec /tmp/d20151112-27349-pedzkr/spec.rb:14 # SixtySixDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-pedzkr/spec.rb:22 # SixtySixDeck behaves like a deck #size returns the size of the deck
rspec /tmp/d20151112-27349-pedzkr/spec.rb:35 # SixtySixDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-pedzkr/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-pedzkr/spec.rb:405 # SixtySixDeck #sort sorts the cards in the defined order
История (2 версии и 1 коментар)
Милена обнови решението на 10.11.2015 22:32 (преди около 9 години)
Милена обнови решението на 10.11.2015 23:06 (преди около 9 години)