Create a gist now

Instantly share code, notes, and snippets.

@pwnela /to-do.rb Secret
Created May 6, 2013

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment