Решение на Седма задача от Йоан Динков
Обратно към всички решения
Към профила на Йоан Динков
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 21 успешни тест(а)
- 10 неуспешни тест(а)
Код
Лог от изпълнението
.....F.....F.FFF..FFFF.F.......
Failures:
1) LazyMode LazyMode::Note can have nested notes
Failure/Error: expect(file.notes.first.body).to eq('')
expected: ""
got: nil
(compared using ==)
# /tmp/d20160107-5693-1e3jafu/spec.rb:114: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 LazyMode::Note #body can have no body
Failure/Error: expect(file.notes.first.body).to eq('')
expected: ""
got: nil
(compared using ==)
# /tmp/d20160107-5693-1e3jafu/spec.rb:94:in `block (4 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 daily repeater
Failure/Error: agenda = file.daily_agenda(LazyMode::Date.new('2012-12-12'))
Timeout::Error:
execution expired
# /tmp/d20160107-5693-1e3jafu/solution.rb:9:in `initialize'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `new'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `next_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:41:in `block in next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `times'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:114:in `match'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `block in notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `select'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:147:in `daily_agenda'
# /tmp/d20160107-5693-1e3jafu/spec.rb:152: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#daily_agenda returns note scheduled with weekly repeater
Failure/Error: agenda = file.daily_agenda(LazyMode::Date.new('2012-12-12'))
Timeout::Error:
execution expired
# /tmp/d20160107-5693-1e3jafu/solution.rb:9:in `initialize'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `new'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `next_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:41:in `block in next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `times'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:114:in `match'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `block in notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `select'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:147:in `daily_agenda'
# /tmp/d20160107-5693-1e3jafu/spec.rb:174: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#daily_agenda returns note scheduled with monthly repeater
Failure/Error: agenda = file.daily_agenda(LazyMode::Date.new('2013-01-12'))
Timeout::Error:
execution expired
# /tmp/d20160107-5693-1e3jafu/solution.rb:9:in `map'
# /tmp/d20160107-5693-1e3jafu/solution.rb:9:in `initialize'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `new'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `next_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:41:in `block in next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `times'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:114:in `match'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `block in notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `select'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:147:in `daily_agenda'
# /tmp/d20160107-5693-1e3jafu/spec.rb:197: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 without repeater
Failure/Error: expect(agenda.notes.size).to eq(1)
expected: 1
got: 0
(compared using ==)
# /tmp/d20160107-5693-1e3jafu/spec.rb:249: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 multiple notes with different dates when scheduled with daily repeater
Failure/Error: expect(agenda.notes.size).to eq(2)
expected: 2
got: 0
(compared using ==)
# /tmp/d20160107-5693-1e3jafu/spec.rb:271: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 returns note scheduled with weekly repeater
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2012-12-10'))
Timeout::Error:
execution expired
# /tmp/d20160107-5693-1e3jafu/solution.rb:9:in `initialize'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `new'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `next_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:41:in `block in next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `times'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:114:in `match'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `block in notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `select'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:151:in `weekly_agenda'
# /tmp/d20160107-5693-1e3jafu/spec.rb:294: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 note scheduled with monthly repeater
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2013-01-10'))
Timeout::Error:
execution expired
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `next_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:41:in `block in next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `times'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:114:in `match'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `block in notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `select'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:151:in `weekly_agenda'
# /tmp/d20160107-5693-1e3jafu/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)>'
10) LazyMode#weekly_agenda returns nested notes
Failure/Error: agenda = file.weekly_agenda(LazyMode::Date.new('2012-09-05'))
Timeout::Error:
execution expired
# /tmp/d20160107-5693-1e3jafu/solution.rb:9:in `initialize'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `new'
# /tmp/d20160107-5693-1e3jafu/solution.rb:34:in `next_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:41:in `block in next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `times'
# /tmp/d20160107-5693-1e3jafu/solution.rb:40:in `next_occurrence'
# /tmp/d20160107-5693-1e3jafu/solution.rb:114:in `match'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `block in notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `select'
# /tmp/d20160107-5693-1e3jafu/solution.rb:173:in `notes_for_date'
# /tmp/d20160107-5693-1e3jafu/solution.rb:151:in `weekly_agenda'
# /tmp/d20160107-5693-1e3jafu/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)>'
Finished in 6.61 seconds
31 examples, 10 failures
Failed examples:
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:98 # LazyMode LazyMode::Note can have nested notes
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:88 # LazyMode LazyMode::Note #body can have no body
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:141 # LazyMode#daily_agenda returns note scheduled with daily repeater
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:163 # LazyMode#daily_agenda returns note scheduled with weekly repeater
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:186 # LazyMode#daily_agenda returns note scheduled with monthly repeater
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:237 # LazyMode#weekly_agenda returns note scheduled without repeater
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:259 # LazyMode#weekly_agenda returns multiple notes with different dates when scheduled with daily repeater
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:283 # LazyMode#weekly_agenda returns note scheduled with weekly repeater
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:315 # LazyMode#weekly_agenda returns note scheduled with monthly repeater
rspec /tmp/d20160107-5693-1e3jafu/spec.rb:348 # LazyMode#weekly_agenda returns nested notes
История (3 версии и 0 коментара)
Йоан обнови решението на 19.12.2015 18:55 (преди около 9 години)
Йоан обнови решението на 19.12.2015 19:10 (преди около 9 години)
Йоан обнови решението на 21.12.2015 01:06 (преди около 9 години)