secret
Created

  • Download Gist
to-do.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
require 'rspec'
 
class List
attr_accessor :tasks
 
def initialize
@tasks = []
end
 
def add_task(list_task)
tasks << list_task
end
end
 
class Task
attr_accessor :description
 
def initialize(description)
@description = description
end
end
 
describe 'to do list' do
it "adds a task to the to do list" do
list = List.new
task = Task.new("do stuff")
 
list.add_task(task)
list.tasks.include?(task).should == true
end
 
pending "removes a task from the do list"
pending "adds a deadline to a task"
pending "sets a priority for a task"
pending "marks a task as completed"
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.