Решение на Шеста задача от Нели Хатева
Обратно към всички решения
Към профила на Нели Хатева
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 41 успешни тест(а)
- 6 неуспешни тест(а)
Код
Лог от изпълнението
....................F.F........FF....FF........
Failures:
1) Money arithmetic * with money objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `to_d' for 5.00 USD:Money>
# /tmp/d20130203-23049-1tj8674/spec.rb:129:in `block (4 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) Money arithmetic / with money objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `to_d' for 5.00 USD:Money>
# /tmp/d20130203-23049-1tj8674/spec.rb:129:in `block (4 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) Money arithmetic * with other objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError but nothing was raised
# /tmp/d20130203-23049-1tj8674/spec.rb:160:in `block (4 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) Money arithmetic / with other objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError but nothing was raised
# /tmp/d20130203-23049-1tj8674/spec.rb:160:in `block (4 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) Money comparison with == raises ArgumentError when comparing with other objects
Failure/Error: expect do
expected ArgumentError but nothing was raised
# /tmp/d20130203-23049-1tj8674/spec.rb:195:in `block (4 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) Money comparison with == raises IncompatibleCurrencies when currencies differ
Failure/Error: expect do
expected Money::IncompatibleCurrencies but nothing was raised
# /tmp/d20130203-23049-1tj8674/spec.rb:201:in `block (4 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.05806 seconds
47 examples, 6 failures
Failed examples:
rspec /tmp/d20130203-23049-1tj8674/spec.rb:128 # Money arithmetic * with money objects raises an ArgumentError
rspec /tmp/d20130203-23049-1tj8674/spec.rb:128 # Money arithmetic / with money objects raises an ArgumentError
rspec /tmp/d20130203-23049-1tj8674/spec.rb:159 # Money arithmetic * with other objects raises an ArgumentError
rspec /tmp/d20130203-23049-1tj8674/spec.rb:159 # Money arithmetic / with other objects raises an ArgumentError
rspec /tmp/d20130203-23049-1tj8674/spec.rb:194 # Money comparison with == raises ArgumentError when comparing with other objects
rspec /tmp/d20130203-23049-1tj8674/spec.rb:200 # Money comparison with == raises IncompatibleCurrencies when currencies differ
История (4 версии и 2 коментара)
Нели обнови решението на 11.01.2013 00:51 (преди около 12 години)
Нели обнови решението на 11.01.2013 19:13 (преди около 12 години)
Нели обнови решението на 14.01.2013 00:01 (преди около 12 години)
Нели обнови решението на 14.01.2013 18:01 (преди около 12 години)