Решение на Четвърта задача от Димитър Узунов
Обратно към всички решения
Към профила на Димитър Узунов
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 39 успешни тест(а)
- 18 неуспешни тест(а)
Код
Лог от изпълнението
...FF.FFFF......FF.FFFF....................FF.FFFF.......
Failures:
1) WarDeck behaves like a deck implements Enumerable
Failure/Error: expect(small_deck).to respond_to(:each)
expected #<WarDeck:0x007f7ac1955e78 @cards=[#<Card:0x007f7ac19560f8 @rank=:ace, @suit=:spades>, #<Card:0x007f7ac1956030 @rank=9, @suit=:clubs>]> to respond to :each
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:140
# /tmp/d20151112-27349-lq0nur/spec.rb:10: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 `each' for #<WarDeck:0x007f7ac193d698>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:140
# /tmp/d20151112-27349-lq0nur/spec.rb:18:in `to_a'
# /tmp/d20151112-27349-lq0nur/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 `each' for #<WarDeck:0x007f7ac27b1d50>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:140
# /tmp/d20151112-27349-lq0nur/spec.rb:30:in `to_a'
# /tmp/d20151112-27349-lq0nur/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 `each' for #<WarDeck:0x007f7ac2817920>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:140
# /tmp/d20151112-27349-lq0nur/spec.rb:37:in `to_a'
# /tmp/d20151112-27349-lq0nur/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.to_a).to eq [ace_of_spades, nine_of_clubs]
NoMethodError:
undefined method `each' for #<WarDeck:0x007f7ac27d7e88>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:140
# /tmp/d20151112-27349-lq0nur/spec.rb:44:in `to_a'
# /tmp/d20151112-27349-lq0nur/spec.rb:44: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 `each' for #<WarDeck:0x007f7ac27d55c0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:140
# /tmp/d20151112-27349-lq0nur/spec.rb:51:in `to_a'
# /tmp/d20151112-27349-lq0nur/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) BeloteDeck behaves like a deck implements Enumerable
Failure/Error: expect(small_deck).to respond_to(:each)
expected #<BeloteDeck:0x007f7ac27ecdb0 @cards=[#<Card:0x007f7ac27ecf90 @rank=:ace, @suit=:spades>, #<Card:0x007f7ac27ecf40 @rank=9, @suit=:clubs>]> to respond to :each
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:191
# /tmp/d20151112-27349-lq0nur/spec.rb:10: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 fills the deck if no initialize parameters are given
Failure/Error: expect(deck.to_a).to match_array all_available_cards
NoMethodError:
undefined method `each' for #<BeloteDeck:0x007f7ac27ae600>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:191
# /tmp/d20151112-27349-lq0nur/spec.rb:18:in `to_a'
# /tmp/d20151112-27349-lq0nur/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)>'
9) 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 `each' for #<BeloteDeck:0x007f7ac27a00f0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:191
# /tmp/d20151112-27349-lq0nur/spec.rb:30:in `to_a'
# /tmp/d20151112-27349-lq0nur/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)>'
10) 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 `each' for #<BeloteDeck:0x007f7ac27985a8>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:191
# /tmp/d20151112-27349-lq0nur/spec.rb:37:in `to_a'
# /tmp/d20151112-27349-lq0nur/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)>'
11) BeloteDeck behaves like a deck #top peeks at the top-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades, nine_of_clubs]
NoMethodError:
undefined method `each' for #<BeloteDeck:0x007f7ac278dfb8>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:191
# /tmp/d20151112-27349-lq0nur/spec.rb:44:in `to_a'
# /tmp/d20151112-27349-lq0nur/spec.rb:44: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 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 `each' for #<BeloteDeck:0x007f7ac2785520>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:191
# /tmp/d20151112-27349-lq0nur/spec.rb:51:in `to_a'
# /tmp/d20151112-27349-lq0nur/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)>'
13) SixtySixDeck behaves like a deck implements Enumerable
Failure/Error: expect(small_deck).to respond_to(:each)
expected #<SixtySixDeck:0x007f7ac25bf8a8 @cards=[#<Card:0x007f7ac25bf998 @rank=:ace, @suit=:spades>, #<Card:0x007f7ac25bf920 @rank=9, @suit=:clubs>]> to respond to :each
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:400
# /tmp/d20151112-27349-lq0nur/spec.rb:10: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)>'
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
NoMethodError:
undefined method `each' for #<SixtySixDeck:0x007f7ac25bd800>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:400
# /tmp/d20151112-27349-lq0nur/spec.rb:18:in `to_a'
# /tmp/d20151112-27349-lq0nur/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 #draw_top_card pops the top-most card
Failure/Error: expect(small_deck.to_a).to eq [nine_of_clubs]
NoMethodError:
undefined method `each' for #<SixtySixDeck:0x007f7ac258be40>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:400
# /tmp/d20151112-27349-lq0nur/spec.rb:30:in `to_a'
# /tmp/d20151112-27349-lq0nur/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)>'
16) 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 `each' for #<SixtySixDeck:0x007f7ac255eee0>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:400
# /tmp/d20151112-27349-lq0nur/spec.rb:37:in `to_a'
# /tmp/d20151112-27349-lq0nur/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)>'
17) SixtySixDeck behaves like a deck #top peeks at the top-most card
Failure/Error: expect(small_deck.to_a).to eq [ace_of_spades, nine_of_clubs]
NoMethodError:
undefined method `each' for #<SixtySixDeck:0x007f7ac255c730>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:400
# /tmp/d20151112-27349-lq0nur/spec.rb:44:in `to_a'
# /tmp/d20151112-27349-lq0nur/spec.rb:44: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 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 `each' for #<SixtySixDeck:0x007f7ac2551240>
Shared Example Group: "a deck" called from /tmp/d20151112-27349-lq0nur/spec.rb:400
# /tmp/d20151112-27349-lq0nur/spec.rb:51:in `to_a'
# /tmp/d20151112-27349-lq0nur/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)>'
Finished in 0.03814 seconds
57 examples, 18 failures
Failed examples:
rspec /tmp/d20151112-27349-lq0nur/spec.rb:8 # WarDeck behaves like a deck implements Enumerable
rspec /tmp/d20151112-27349-lq0nur/spec.rb:14 # WarDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-lq0nur/spec.rb:28 # WarDeck behaves like a deck #draw_top_card pops the top-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:35 # WarDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:42 # WarDeck behaves like a deck #top peeks at the top-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:49 # WarDeck behaves like a deck #bottom peeks at the bottom-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:8 # BeloteDeck behaves like a deck implements Enumerable
rspec /tmp/d20151112-27349-lq0nur/spec.rb:14 # BeloteDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-lq0nur/spec.rb:28 # BeloteDeck behaves like a deck #draw_top_card pops the top-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:35 # BeloteDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:42 # BeloteDeck behaves like a deck #top peeks at the top-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:49 # BeloteDeck behaves like a deck #bottom peeks at the bottom-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:8 # SixtySixDeck behaves like a deck implements Enumerable
rspec /tmp/d20151112-27349-lq0nur/spec.rb:14 # SixtySixDeck behaves like a deck fills the deck if no initialize parameters are given
rspec /tmp/d20151112-27349-lq0nur/spec.rb:28 # SixtySixDeck behaves like a deck #draw_top_card pops the top-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:35 # SixtySixDeck behaves like a deck #draw_bottom_card pops the bottom-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:42 # SixtySixDeck behaves like a deck #top peeks at the top-most card
rspec /tmp/d20151112-27349-lq0nur/spec.rb:49 # SixtySixDeck behaves like a deck #bottom peeks at the bottom-most card
История (2 версии и 0 коментара)
Димитър обнови решението на 09.11.2015 23:10 (преди около 9 години)
Димитър обнови решението на 10.11.2015 20:22 (преди около 9 години)