Решение на Първа задача от Милена Монова
Обратно към всички решения
Към профила на Милена Монова
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 4 успешни тест(а)
- 4 неуспешни тест(а)
Код
Лог от изпълнението
....FFFF
Failures:
1) #convert_to_bgn rounds to 2 digits after the point
Failure/Error: expect(convert_to_bgn(123, :usd)).to eq 214.12
expected: 214.12
got: 214.11839999999998
(compared using ==)
# /tmp/d20151012-23382-c6io2v/spec.rb:19: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) #compare_prices compares prices of the same currency
Failure/Error: expect(compare_prices(10, :gbp, 8, :gbp)).to be > 0
expected: > 0
got: 0
# /tmp/d20151012-23382-c6io2v/spec.rb:27: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) #compare_prices compares usd and bgn
Failure/Error: expect(compare_prices(100, :usd, 10, :bgn)).to be > 0
expected: > 0
got: 0
# /tmp/d20151012-23382-c6io2v/spec.rb:34: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) #compare_prices compares eur and gbp
Failure/Error: expect(compare_prices(10, :usd, 2, :gbp)).to be > 0
expected: > 0
got: 0
# /tmp/d20151012-23382-c6io2v/spec.rb:39: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.00652 seconds
8 examples, 4 failures
Failed examples:
rspec /tmp/d20151012-23382-c6io2v/spec.rb:18 # #convert_to_bgn rounds to 2 digits after the point
rspec /tmp/d20151012-23382-c6io2v/spec.rb:24 # #compare_prices compares prices of the same currency
rspec /tmp/d20151012-23382-c6io2v/spec.rb:31 # #compare_prices compares usd and bgn
rspec /tmp/d20151012-23382-c6io2v/spec.rb:37 # #compare_prices compares eur and gbp
История (1 версия и 1 коментар)
Милена обнови решението на 12.10.2015 00:27 (преди около 9 години)