Решение на Първа задача от Георги Урумов
Обратно към всички решения
Към профила на Георги Урумов
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 11 успешни тест(а)
- 3 неуспешни тест(а)
Код
Лог от изпълнението
F....F......F.
Failures:
1) Integer#prime? checks if a number is prime
Failure/Error: 1.prime?.should eq false
expected: false
got: true
(compared using ==)
# /tmp/d20131023-4395-18ujdge/spec.rb:5: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) Integer#digits works with negative numbers
Failure/Error: (-33).digits.should eq [3, 3]
expected: [3, 3]
got: [0, 3, 3]
(compared using ==)
# /tmp/d20131023-4395-18ujdge/spec.rb:51: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) Array#combine_with combines two arrays by alternatingly taking elements
Failure/Error: [1, 2, 3].combine_with([:a, :b, :c, :d, :e]).should eq [1, :a, 2, :b, 3, :c, :d, :e]
expected: [1, :a, 2, :b, 3, :c, :d, :e]
got: [:a, 1, :b, 2, :c, 3, :d, :e]
(compared using ==)
# /tmp/d20131023-4395-18ujdge/spec.rb:108: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.02028 seconds
14 examples, 3 failures
Failed examples:
rspec /tmp/d20131023-4395-18ujdge/spec.rb:2 # Integer#prime? checks if a number is prime
rspec /tmp/d20131023-4395-18ujdge/spec.rb:50 # Integer#digits works with negative numbers
rspec /tmp/d20131023-4395-18ujdge/spec.rb:103 # Array#combine_with combines two arrays by alternatingly taking elements
История (2 версии и 0 коментара)
Георги обнови решението на 16.10.2013 12:26 (преди около 11 години)
Георги обнови решението на 16.10.2013 13:43 (преди около 11 години)