Skip to content

Instantly share code, notes, and snippets.

@pwnela

pwnela/to-do.rb Secret

Created May 6, 2013 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwnela/1e988cc051b69405877c to your computer and use it in GitHub Desktop.
Save pwnela/1e988cc051b69405877c to your computer and use it in GitHub Desktop.
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