Решение на Втора задача от Илия Ватахов
Обратно към всички решения
Към профила на Илия Ватахов
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 12 успешни тест(а)
- 10 неуспешни тест(а)
Код
Лог от изпълнението
F....FFF.F.FFFFF......
Failures:
1) TodoList filters tasks by status
Failure/Error: ]
expected collection contained: ["Do the 5th Ruby challenge.", "Have some tea."]
actual collection contained: []
the missing elements were: ["Do the 5th Ruby challenge.", "Have some tea."]
# /tmp/d20131107-4393-kfpsxy/spec.rb:22: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) TodoList supports a conjuction of filters
Failure/Error: filtered.map(&:description).should =~ ['Eat spaghetti.', 'Destroy Facebook and Google.', 'Occupy Sofia University.']
expected collection contained: ["Destroy Facebook and Google.", "Eat spaghetti.", "Occupy Sofia University."]
actual collection contained: []
the missing elements were: ["Destroy Facebook and Google.", "Eat spaghetti.", "Occupy Sofia University."]
# /tmp/d20131107-4393-kfpsxy/spec.rb:52: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) TodoList supports a disjunction of filters
Failure/Error: ]
expected collection contained: ["Do the 5th Ruby challenge.", "Find missing socks.", "Get 8 hours of sleep.", "Have some tea."]
actual collection contained: ["Find missing socks.", "Get 8 hours of sleep."]
the missing elements were: ["Do the 5th Ruby challenge.", "Have some tea."]
# /tmp/d20131107-4393-kfpsxy/spec.rb:62: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) TodoList supports a negation of filters
Failure/Error: ]
expected collection contained: ["Do the 5th Ruby challenge.", "Grok Ruby.", "Have some tea.", "Party animal."]
actual collection contained: ["Destroy Facebook and Google.", "Do the 5th Ruby challenge.", "Eat spaghetti.", "Find missing socks.", "Get 8 hours of sleep.", "Grok Ruby.", "Have some tea.", "Occupy Sofia University.", "Party animal."]
the extra elements were: ["Destroy Facebook and Google.", "Eat spaghetti.", "Find missing socks.", "Get 8 hours of sleep.", "Occupy Sofia University."]
# /tmp/d20131107-4393-kfpsxy/spec.rb:72: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) TodoList supports complex filters combination
Failure/Error: ]
expected collection contained: ["Destroy Facebook and Google.", "Eat spaghetti.", "Have some tea.", "Occupy Sofia University.", "Party animal."]
actual collection contained: ["Have some tea.", "Party animal."]
the missing elements were: ["Destroy Facebook and Google.", "Eat spaghetti.", "Occupy Sofia University."]
# /tmp/d20131107-4393-kfpsxy/spec.rb:92: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) TodoList constructs an object for each task
Failure/Error: task.status.should eq :todo
expected: :todo
got: :" todo"
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-:todo
+:" todo"
# /tmp/d20131107-4393-kfpsxy/spec.rb:112: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) TodoList returns the number of the tasks todo
Failure/Error: todo_list.tasks_todo.should eq 5
expected: 5
got: 0
(compared using ==)
# /tmp/d20131107-4393-kfpsxy/spec.rb:119: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) TodoList returns the number of the tasks in progress
Failure/Error: todo_list.tasks_in_progress.should eq 2
expected: 2
got: 0
(compared using ==)
# /tmp/d20131107-4393-kfpsxy/spec.rb:123: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)>'
9) TodoList returns the number of the completed tasks
Failure/Error: todo_list.tasks_completed.should eq 2
expected: 2
got: 0
(compared using ==)
# /tmp/d20131107-4393-kfpsxy/spec.rb:127: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)>'
10) TodoList checks if all tasks are completed
Failure/Error: todo_list.completed?.should eq false
NoMethodError:
undefined method `completed?' for #<TodoList:0xb93aab88>
# /tmp/d20131107-4393-kfpsxy/spec.rb:131: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.04445 seconds
22 examples, 10 failures
Failed examples:
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:18 # TodoList filters tasks by status
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:50 # TodoList supports a conjuction of filters
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:55 # TodoList supports a disjunction of filters
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:65 # TodoList supports a negation of filters
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:80 # TodoList supports complex filters combination
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:109 # TodoList constructs an object for each task
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:118 # TodoList returns the number of the tasks todo
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:122 # TodoList returns the number of the tasks in progress
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:126 # TodoList returns the number of the completed tasks
rspec /tmp/d20131107-4393-kfpsxy/spec.rb:130 # TodoList checks if all tasks are completed
История (5 версии и 0 коментара)
Илия обнови решението на 06.11.2013 00:05 (преди около 11 години)
Илия обнови решението на 06.11.2013 09:50 (преди около 11 години)
Илия обнови решението на 06.11.2013 10:29 (преди около 11 години)
Илия обнови решението на 06.11.2013 10:49 (преди около 11 години)
Илия обнови решението на 06.11.2013 10:51 (преди около 11 години)