Решение на Втора задача от Ангел Николов
Обратно към всички решения
Към профила на Ангел Николов
Резултати
- 1 точка от тестове
- 0 бонус точки
- 1 точка общо
- 2 успешни тест(а)
- 9 неуспешни тест(а)
Код
Лог от изпълнението
FFFFFF..FFF
Failures:
1) Collection can find all the artists in the collection
Failure/Error: ]
expected collection contained: ["Bill Evans", "Eva Cassidy", "John Coltrane", "Norah Johnes", "Pearl Jam", "Sting", "Thelonious Monk"]
actual collection contained: ["", "A Love Supreme", "Autumn Leaves", "Come Away With Me", "Eva Cassidy", "Live at Blues Alley", "Mad About You", "Pearl Jam", "Sting", "Thelonious Monk", "Yield"]
the missing elements were: ["Bill Evans", "John Coltrane", "Norah Johnes"]
the extra elements were: ["", "A Love Supreme", "Autumn Leaves", "Come Away With Me", "Live at Blues Alley", "Mad About You", "Yield"]
# /tmp/d20130203-23049-ttxn5/spec.rb:13:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) Collection can find all the names of all songs in the collection
Failure/Error: ]
expected collection contained: ["Acknowledgment", "Autumn Leaves", "Brain of J.F.K", "Come Away With Me", "Fields of Gold", "Jeremy", "Mad About You", "Ruby, My Dear"]
actual collection contained: ["", "Autumn Leaves", "Eva Cassidy", "Fields of Gold", "Jeremy", "John Coltrane", "One", "Pearl Jam", "Portrait in Jazz", "Ruby, My Dear", "The Soul Cages"]
the missing elements were: ["Acknowledgment", "Brain of J.F.K", "Come Away With Me", "Mad About You"]
the extra elements were: ["", "Eva Cassidy", "John Coltrane", "One", "Pearl Jam", "Portrait in Jazz", "The Soul Cages"]
# /tmp/d20130203-23049-ttxn5/spec.rb:26:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) Collection can find all the albums in the collection
Failure/Error: ]
expected collection contained: ["A Love Supreme", "Live at Blues Alley", "Mysterioso", "One", "Portrait in Jazz", "Ten", "Ten Summoner's Tales", "The Soul Cages", "Yield"]
actual collection contained: ["", "Acknowledgment", "Bill Evans", "Brain of J.F.K", "Fields of Gold", "Live at Blues Alley", "Mysterioso", "Norah Johnes", "Sting", "Ten", "Ten Summoner's Tales"]
the missing elements were: ["A Love Supreme", "One", "Portrait in Jazz", "The Soul Cages", "Yield"]
the extra elements were: ["", "Acknowledgment", "Bill Evans", "Brain of J.F.K", "Fields of Gold", "Norah Johnes", "Sting"]
# /tmp/d20130203-23049-ttxn5/spec.rb:40:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) Collection can be filtered by song name
Failure/Error: filtered.map(&:artist).should =~ ['Eva Cassidy', 'Sting']
expected collection contained: ["Eva Cassidy", "Sting"]
actual collection contained: ["Sting"]
the missing elements were: ["Eva Cassidy"]
# /tmp/d20130203-23049-ttxn5/spec.rb:45:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) Collection can be filtered by song name
Failure/Error: filtered.map(&:album).should =~ ['The Soul Cages', "Ten Summoner's Tales"]
expected collection contained: ["Ten Summoner's Tales", "The Soul Cages"]
actual collection contained: ["Ten Summoner's Tales"]
the missing elements were: ["The Soul Cages"]
# /tmp/d20130203-23049-ttxn5/spec.rb:50:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) Collection can be filtered by album
Failure/Error: filtered.map(&:name).should =~ ['Fields of Gold', 'Autumn Leaves']
expected collection contained: ["Autumn Leaves", "Fields of Gold"]
actual collection contained: ["Autumn Leaves"]
the missing elements were: ["Fields of Gold"]
# /tmp/d20130203-23049-ttxn5/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) Collection supports a disjunction of filters
Failure/Error: ]
expected collection contained: ["Live at Blues Alley", "Ten Summoner's Tales", "The Soul Cages"]
actual collection contained: ["Ten Summoner's Tales"]
the missing elements were: ["Live at Blues Alley", "The Soul Cages"]
# /tmp/d20130203-23049-ttxn5/spec.rb:74:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) Collection supports negation of filters
Failure/Error: filtered.map(&:name).should eq ['Mad About You']
expected: ["Mad About You"]
got: []
(compared using ==)
# /tmp/d20130203-23049-ttxn5/spec.rb:79:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) Collection can be adjoined with another collection
Failure/Error: adjoined.count.should eq 4
expected: 4
got: 2
(compared using ==)
# /tmp/d20130203-23049-ttxn5/spec.rb:87:in `block (2 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/homework/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01198 seconds
11 examples, 9 failures
Failed examples:
rspec /tmp/d20130203-23049-ttxn5/spec.rb:4 # Collection can find all the artists in the collection
rspec /tmp/d20130203-23049-ttxn5/spec.rb:16 # Collection can find all the names of all songs in the collection
rspec /tmp/d20130203-23049-ttxn5/spec.rb:29 # Collection can find all the albums in the collection
rspec /tmp/d20130203-23049-ttxn5/spec.rb:43 # Collection can be filtered by song name
rspec /tmp/d20130203-23049-ttxn5/spec.rb:48 # Collection can be filtered by song name
rspec /tmp/d20130203-23049-ttxn5/spec.rb:53 # Collection can be filtered by album
rspec /tmp/d20130203-23049-ttxn5/spec.rb:68 # Collection supports a disjunction of filters
rspec /tmp/d20130203-23049-ttxn5/spec.rb:77 # Collection supports negation of filters
rspec /tmp/d20130203-23049-ttxn5/spec.rb:82 # Collection can be adjoined with another collection
История (2 версии и 0 коментара)
Ангел обнови решението на 31.10.2012 16:26 (преди около 12 години)
Ангел обнови решението на 31.10.2012 16:54 (преди около 12 години)