Решение на Шеста задача от Йоана Тодорова
Обратно към всички решения
Към профила на Йоана Тодорова
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 29 успешни тест(а)
- 18 неуспешни тест(а)
Код
Лог от изпълнението
.......................F.FF.FFF....FFFFFFFFFFFF
Failures:
1) Money arithmetic + with numeric objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `currency' for 42:Fixnum>
# /tmp/d20130203-23049-blldjg/spec.rb:137: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 raises Money::IncompatibleCurrencies for + with money with different currencies
Failure/Error: expect do
expected Money::IncompatibleCurrencies, got #<ArgumentError: ArgumentError>
# /tmp/d20130203-23049-blldjg/spec.rb:152: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 numeric objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `currency' for 42:Fixnum>
# /tmp/d20130203-23049-blldjg/spec.rb:137: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 raises Money::IncompatibleCurrencies for - with money with different currencies
Failure/Error: expect do
expected Money::IncompatibleCurrencies, got #<ArgumentError: ArgumentError>
# /tmp/d20130203-23049-blldjg/spec.rb:152: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 arithmetic + with other objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `currency' for "foobar":String>
# /tmp/d20130203-23049-blldjg/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)>'
6) Money arithmetic - with other objects raises an ArgumentError
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `currency' for "foobar":String>
# /tmp/d20130203-23049-blldjg/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)>'
7) Money comparison with <=> raises ArgumentError when comparing with other objects
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `amount' for :larodi:Symbol>
# /tmp/d20130203-23049-blldjg/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)>'
8) Money comparison with <=> raises IncompatibleCurrencies when currencies differ
Failure/Error: expect do
expected Money::IncompatibleCurrencies but nothing was raised
# /tmp/d20130203-23049-blldjg/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)>'
9) Money comparison with == raises ArgumentError when comparing with other objects
Failure/Error: expect do
expected ArgumentError but nothing was raised
# /tmp/d20130203-23049-blldjg/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)>'
10) Money comparison with == raises IncompatibleCurrencies when currencies differ
Failure/Error: expect do
expected Money::IncompatibleCurrencies but nothing was raised
# /tmp/d20130203-23049-blldjg/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)>'
11) Money comparison with < raises ArgumentError when comparing with other objects
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `amount' for :larodi:Symbol>
# /tmp/d20130203-23049-blldjg/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)>'
12) Money comparison with < raises IncompatibleCurrencies when currencies differ
Failure/Error: expect do
expected Money::IncompatibleCurrencies but nothing was raised
# /tmp/d20130203-23049-blldjg/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)>'
13) Money comparison with <= raises ArgumentError when comparing with other objects
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `amount' for :larodi:Symbol>
# /tmp/d20130203-23049-blldjg/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)>'
14) Money comparison with <= raises IncompatibleCurrencies when currencies differ
Failure/Error: expect do
expected Money::IncompatibleCurrencies but nothing was raised
# /tmp/d20130203-23049-blldjg/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)>'
15) Money comparison with > raises ArgumentError when comparing with other objects
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `amount' for :larodi:Symbol>
# /tmp/d20130203-23049-blldjg/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)>'
16) Money comparison with > raises IncompatibleCurrencies when currencies differ
Failure/Error: expect do
expected Money::IncompatibleCurrencies but nothing was raised
# /tmp/d20130203-23049-blldjg/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)>'
17) Money comparison with >= raises ArgumentError when comparing with other objects
Failure/Error: expect do
expected ArgumentError, got #<NoMethodError: undefined method `amount' for :larodi:Symbol>
# /tmp/d20130203-23049-blldjg/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)>'
18) Money comparison with >= raises IncompatibleCurrencies when currencies differ
Failure/Error: expect do
expected Money::IncompatibleCurrencies but nothing was raised
# /tmp/d20130203-23049-blldjg/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.06073 seconds
47 examples, 18 failures
Failed examples:
rspec /tmp/d20130203-23049-blldjg/spec.rb:136 # Money arithmetic + with numeric objects raises an ArgumentError
rspec /tmp/d20130203-23049-blldjg/spec.rb:151 # Money arithmetic raises Money::IncompatibleCurrencies for + with money with different currencies
rspec /tmp/d20130203-23049-blldjg/spec.rb:136 # Money arithmetic - with numeric objects raises an ArgumentError
rspec /tmp/d20130203-23049-blldjg/spec.rb:151 # Money arithmetic raises Money::IncompatibleCurrencies for - with money with different currencies
rspec /tmp/d20130203-23049-blldjg/spec.rb:159 # Money arithmetic + with other objects raises an ArgumentError
rspec /tmp/d20130203-23049-blldjg/spec.rb:159 # Money arithmetic - with other objects raises an ArgumentError
rspec /tmp/d20130203-23049-blldjg/spec.rb:194 # Money comparison with <=> raises ArgumentError when comparing with other objects
rspec /tmp/d20130203-23049-blldjg/spec.rb:200 # Money comparison with <=> raises IncompatibleCurrencies when currencies differ
rspec /tmp/d20130203-23049-blldjg/spec.rb:194 # Money comparison with == raises ArgumentError when comparing with other objects
rspec /tmp/d20130203-23049-blldjg/spec.rb:200 # Money comparison with == raises IncompatibleCurrencies when currencies differ
rspec /tmp/d20130203-23049-blldjg/spec.rb:194 # Money comparison with < raises ArgumentError when comparing with other objects
rspec /tmp/d20130203-23049-blldjg/spec.rb:200 # Money comparison with < raises IncompatibleCurrencies when currencies differ
rspec /tmp/d20130203-23049-blldjg/spec.rb:194 # Money comparison with <= raises ArgumentError when comparing with other objects
rspec /tmp/d20130203-23049-blldjg/spec.rb:200 # Money comparison with <= raises IncompatibleCurrencies when currencies differ
rspec /tmp/d20130203-23049-blldjg/spec.rb:194 # Money comparison with > raises ArgumentError when comparing with other objects
rspec /tmp/d20130203-23049-blldjg/spec.rb:200 # Money comparison with > raises IncompatibleCurrencies when currencies differ
rspec /tmp/d20130203-23049-blldjg/spec.rb:194 # Money comparison with >= raises ArgumentError when comparing with other objects
rspec /tmp/d20130203-23049-blldjg/spec.rb:200 # Money comparison with >= raises IncompatibleCurrencies when currencies differ
История (1 версия и 0 коментара)
Йоана обнови решението на 16.01.2013 14:13 (преди почти 12 години)