Closed fntz closed 12 years ago
Hi fntzr, that is really cool, the commands where completely not tested. I must admit, looking at your code I also learned a couple of cool trick when testing, especially the following:
'R2do::UI.stub!(:input) { "Y" }'
and
'Object.should_receive(:puts).with("Selected task 'NewTask'")'
I didn't know you could do it like that! :))
The code looks really nice and I will merge it immediately.
Thank you for the great work.
You're welcome :)
HI, I just noticed a small thing with showing all the tasks. The code does not take into consideration that a task description has a max length of 30 characters. The output risks or not being properly aligned. Should I change it or would you like to do it?
#List all tags in state
#@param [void]
#@return [void]
def all_tasks()
UI.status(" "*4+"Task" + " "*16 + "Category")
UI.status(" "*4 + "-"*30)
@state.categories.each do |name, category|
category.tasks.each do |task|
result = StringIO.new
result << " %-15s %s\n" % [task.description, name]
UI.status(result.string)
end
end
end
cheers,
Chris
You change, if it is not difficult to you.
Thanks.
LOL no it's not difficult... was just being polite :) since you wrote the code.
cheers
:) You already to rewrite the code for sqlite?
Actually yes... using DataMapper as the ORM and it's nearly done.
Make a separate branch, I would help write the code.
Hi.
I added tests for commands. Also I added a command to display all tasks into categories.
And i added spec task in Rakefile. Thanks.