Решение на Седма задача от Петър Нетовски
Обратно към всички решения
Към профила на Петър Нетовски
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 17 успешни тест(а)
- 14 неуспешни тест(а)
Код
Лог от изпълнението
.............FFF..FFFFFFFFFFF..
Failures:
1) LazyMode#daily_agenda returns note scheduled with daily repeater
Failure/Error: expect(agenda.notes.size).to eq(1)
expected: 1
got: 0
(compared using ==)
# /tmp/d20160107-5693-ahi0dw/spec.rb:153:in `block (3 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) LazyMode#daily_agenda returns note scheduled with weekly repeater
Failure/Error: scheduled '2012-12-5 +1w'
NoMethodError:
undefined method `[]' for nil:NilClass
# /tmp/d20160107-5693-ahi0dw/solution.rb:33:in `scheduled'
# /tmp/d20160107-5693-ahi0dw/spec.rb:166:in `block (5 levels) in <top (required)>'
# /tmp/d20160107-5693-ahi0dw/solution.rb:72:in `instance_eval'
# /tmp/d20160107-5693-ahi0dw/solution.rb:72:in `note'
# /tmp/d20160107-5693-ahi0dw/spec.rb:165:in `block (4 levels) in <top (required)>'
# /tmp/d20160107-5693-ahi0dw/solution.rb:109:in `instance_eval'
# /tmp/d20160107-5693-ahi0dw/solution.rb:109:in `create_file'
# /tmp/d20160107-5693-ahi0dw/spec.rb:164:in `block (3 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) LazyMode#daily_agenda returns note scheduled with monthly repeater
Failure/Error: expect(agenda.notes.size).to eq(1)
expected: 1
got: 0
(compared using ==)
# /tmp/d20160107-5693-ahi0dw/spec.rb:198:in `block (3 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) LazyMode#weekly_agenda returns note scheduled without repeater
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2012-12-06'))
NoMethodError:
undefined method `weekly_agenda' for #<LazyMode::File:0x007fd974170728>
# /tmp/d20160107-5693-ahi0dw/spec.rb:248:in `block (3 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) LazyMode#weekly_agenda returns multiple notes with different dates when scheduled with daily repeater
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2012-12-06'))
NoMethodError:
undefined method `weekly_agenda' for #<LazyMode::File:0x007fd974165ad0>
# /tmp/d20160107-5693-ahi0dw/spec.rb:270:in `block (3 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) LazyMode#weekly_agenda returns note scheduled with weekly repeater
Failure/Error: scheduled '2012-12-5 +1w'
NoMethodError:
undefined method `[]' for nil:NilClass
# /tmp/d20160107-5693-ahi0dw/solution.rb:33:in `scheduled'
# /tmp/d20160107-5693-ahi0dw/spec.rb:286:in `block (5 levels) in <top (required)>'
# /tmp/d20160107-5693-ahi0dw/solution.rb:72:in `instance_eval'
# /tmp/d20160107-5693-ahi0dw/solution.rb:72:in `note'
# /tmp/d20160107-5693-ahi0dw/spec.rb:285:in `block (4 levels) in <top (required)>'
# /tmp/d20160107-5693-ahi0dw/solution.rb:109:in `instance_eval'
# /tmp/d20160107-5693-ahi0dw/solution.rb:109:in `create_file'
# /tmp/d20160107-5693-ahi0dw/spec.rb:284:in `block (3 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) LazyMode#weekly_agenda returns note scheduled with monthly repeater
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2013-01-10'))
NoMethodError:
undefined method `weekly_agenda' for #<LazyMode::File:0x007fd9741f0d60>
# /tmp/d20160107-5693-ahi0dw/spec.rb:326:in `block (3 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) LazyMode#weekly_agenda does not return note whose start date is in the future
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2012-10-12'))
NoMethodError:
undefined method `weekly_agenda' for #<LazyMode::File:0x007fd974206318>
# /tmp/d20160107-5693-ahi0dw/spec.rb:344:in `block (3 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)>'
9) LazyMode#weekly_agenda returns nested notes
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2012-09-05'))
NoMethodError:
undefined method `weekly_agenda' for #<LazyMode::File:0x007fd9741fe2a8>
# /tmp/d20160107-5693-ahi0dw/spec.rb:359:in `block (3 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)>'
10) LazyMode#where filters by tag
Failure/Error: notes = @agenda.where(tag: :important).notes
NoMethodError:
undefined method `where' for #<#<Class:0x007fd9741f9f28>:0x007fd9741f9190>
# /tmp/d20160107-5693-ahi0dw/spec.rb:391:in `block (3 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)>'
11) LazyMode#where filters by body text
Failure/Error: notes = @agenda.where(text: /Very/).notes
NoMethodError:
undefined method `where' for #<#<Class:0x007fd9741e81b0>:0x007fd9741e7a80>
# /tmp/d20160107-5693-ahi0dw/spec.rb:409:in `block (3 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)>'
12) LazyMode#where filters by header text
Failure/Error: notes = @agenda.where(text: /not important/).notes
NoMethodError:
undefined method `where' for #<#<Class:0x007fd9741df3a8>:0x007fd9741deb88>
# /tmp/d20160107-5693-ahi0dw/spec.rb:421:in `block (3 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)>'
13) LazyMode#where filters by status
Failure/Error: notes = @agenda.where(status: :postponed).notes
NoMethodError:
undefined method `where' for #<#<Class:0x007fd974112b50>:0x007fd974112330>
# /tmp/d20160107-5693-ahi0dw/spec.rb:433:in `block (3 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)>'
14) LazyMode#where filters by multiple filters
Failure/Error: notes = @agenda.where(text: /important/, status: :postponed).notes
NoMethodError:
undefined method `where' for #<#<Class:0x007fd9741d9958>:0x007fd9741d9278>
# /tmp/d20160107-5693-ahi0dw/spec.rb:444:in `block (3 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.01858 seconds
31 examples, 14 failures
Failed examples:
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:141 # LazyMode#daily_agenda returns note scheduled with daily repeater
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:163 # LazyMode#daily_agenda returns note scheduled with weekly repeater
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:186 # LazyMode#daily_agenda returns note scheduled with monthly repeater
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:237 # LazyMode#weekly_agenda returns note scheduled without repeater
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:259 # LazyMode#weekly_agenda returns multiple notes with different dates when scheduled with daily repeater
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:283 # LazyMode#weekly_agenda returns note scheduled with weekly repeater
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:315 # LazyMode#weekly_agenda returns note scheduled with monthly repeater
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:337 # LazyMode#weekly_agenda does not return note whose start date is in the future
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:348 # LazyMode#weekly_agenda returns nested notes
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:390 # LazyMode#where filters by tag
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:408 # LazyMode#where filters by body text
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:420 # LazyMode#where filters by header text
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:432 # LazyMode#where filters by status
rspec /tmp/d20160107-5693-ahi0dw/spec.rb:443 # LazyMode#where filters by multiple filters
История (1 версия и 0 коментара)
Петър обнови решението на 21.12.2015 00:18 (преди около 9 години)