Search⌘ K
AI Features

Back on Task

Explore how to apply test-driven development to define task completeness in Rails applications. Learn to write behavior-focused tests using RSpec, and implement methods to pass these tests while maintaining flexibility and simplicity in your code.

Test for Task

What remains of the definition of done? is the distinction between complete and incomplete tasks. Let’s start with that, with a test for Task:

rsync -avr --progress /usercode/* /usr/local/educative/gatherer --exclude Gemfile --exclude Gemfile.lock --exclude execute_.sh --exclude execute.sh
cd /usr/local/educative/gatherer
clear
bundle exec rspec
Adding test for class Task in task_spec.rb file

We have two specs here. The first says that a brand-new task is not complete. The second marks the task as complete and expects it to be complete.

Testing focus

This test is entirely at the API ...