Решение на Първа задача от Александър Стефанов
Обратно към всички решения
Към профила на Александър Стефанов
Резултати
- 2 точки от тестове
- 0 бонус точки
- 2 точки общо
- 4 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
....FFFFFFFF
Failures:
1) series handles lucas series for base cases
Failure/Error: series('lucas', 1).should eq 2
expected: 2
got: 1
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:25: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) series handles lucas series for odd numbers
Failure/Error: series('lucas', 7).should eq 18
expected: 18
got: 29
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:30: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) series handles lucas series for even numbers
Failure/Error: series('lucas', 8).should eq 29
expected: 29
got: 47
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:35: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)>'
4) series handles lucas series for bigger numbers
Failure/Error: series('lucas', 15).should eq 843
expected: 843
got: 1364
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:40: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)>'
5) series handles summed series for base cases
Failure/Error: series('summed', 1).should eq 3
expected: 3
got: nil
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:45: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)>'
6) series handles summed series for odd numbers
Failure/Error: series('summed', 7).should eq 31
expected: 31
got: nil
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:50: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)>'
7) series handles summed series for even numbers
Failure/Error: series('summed', 8).should eq 50
expected: 50
got: nil
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:55: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) series handles summed series for bigger numbers
Failure/Error: series('summed', 15).should eq 1453
expected: 1453
got: nil
(compared using ==)
# /tmp/d20141023-2426-qzpubh/spec.rb:60: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)>'
Finished in 0.01421 seconds
12 examples, 8 failures
Failed examples:
rspec /tmp/d20141023-2426-qzpubh/spec.rb:24 # series handles lucas series for base cases
rspec /tmp/d20141023-2426-qzpubh/spec.rb:29 # series handles lucas series for odd numbers
rspec /tmp/d20141023-2426-qzpubh/spec.rb:34 # series handles lucas series for even numbers
rspec /tmp/d20141023-2426-qzpubh/spec.rb:39 # series handles lucas series for bigger numbers
rspec /tmp/d20141023-2426-qzpubh/spec.rb:44 # series handles summed series for base cases
rspec /tmp/d20141023-2426-qzpubh/spec.rb:49 # series handles summed series for odd numbers
rspec /tmp/d20141023-2426-qzpubh/spec.rb:54 # series handles summed series for even numbers
rspec /tmp/d20141023-2426-qzpubh/spec.rb:59 # series handles summed series for bigger numbers
История (1 версия и 1 коментар)
Александър обнови решението на 15.10.2014 14:00 (преди около 10 години)