Решение на Първа задача от Илия Беличев
Обратно към всички решения
Към профила на Илия Беличев
Резултати
- 0 точки от тестове
- 0 бонус точки
- 0 точки общо
- 0 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
FFFFFFFF
Failures:
1) #convert_to_bgn converts usd
Failure/Error: expect(convert_to_bgn(1000, :usd)).to eq 1740.8
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/spec.rb:3: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) #convert_to_bgn converts eur
Failure/Error: expect(convert_to_bgn(1000, :eur)).to eq 1955.7
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/spec.rb:7: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) #convert_to_bgn converts gbp
Failure/Error: expect(convert_to_bgn(1000, :gbp)).to eq 2641.5
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/spec.rb:11: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) #convert_to_bgn converts bgn
Failure/Error: expect(convert_to_bgn(333, :bgn)).to eq 333
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/spec.rb:15: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) #convert_to_bgn rounds to 2 digits after the point
Failure/Error: expect(convert_to_bgn(123, :usd)).to eq 214.12
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/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)>'
6) #compare_prices compares prices of the same currency
Failure/Error: expect(compare_prices(10, :usd, 13, :usd)).to be < 0
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/solution.rb:14:in `compare_prices'
# /tmp/d20151012-23382-1bhu31d/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)>'
7) #compare_prices compares usd and bgn
Failure/Error: expect(compare_prices(5, :usd, 10, :bgn)).to be < 0
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/solution.rb:14:in `compare_prices'
# /tmp/d20151012-23382-1bhu31d/spec.rb:32: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) #compare_prices compares eur and gbp
Failure/Error: expect(compare_prices(5, :usd, 10, :gbp)).to be < 0
NameError:
uninitialized constant Money_map
# /tmp/d20151012-23382-1bhu31d/solution.rb:10:in `convert_to_bgn'
# /tmp/d20151012-23382-1bhu31d/solution.rb:14:in `compare_prices'
# /tmp/d20151012-23382-1bhu31d/spec.rb:38: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.01098 seconds
8 examples, 8 failures
Failed examples:
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:2 # #convert_to_bgn converts usd
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:6 # #convert_to_bgn converts eur
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:10 # #convert_to_bgn converts gbp
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:14 # #convert_to_bgn converts bgn
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:18 # #convert_to_bgn rounds to 2 digits after the point
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:24 # #compare_prices compares prices of the same currency
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:31 # #compare_prices compares usd and bgn
rspec /tmp/d20151012-23382-1bhu31d/spec.rb:37 # #compare_prices compares eur and gbp
История (2 версии и 4 коментара)
Илия обнови решението на 08.10.2015 15:39 (преди около 9 години)
Илия обнови решението на 12.10.2015 15:29 (преди около 9 години)