summaryrefslogtreecommitdiffstats
path: root/test/command_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/command_test.rb')
-rw-r--r--test/command_test.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/command_test.rb b/test/command_test.rb
index 0b3b5c1..5a2e003 100644
--- a/test/command_test.rb
+++ b/test/command_test.rb
@@ -67,4 +67,33 @@ class CommandTest < Test::Unit::TestCase
start *%w[ 456 123 do stuff ]
end
+ def test_stop
+ entry = stub
+ HCl::DayEntry.expects(:with_timer).returns(entry)
+ entry.expects(:append_note).with('all done')
+ entry.expects(:toggle)
+ stop 'all done'
+ end
+
+ def test_resume
+ entry = stub
+ HCl::DayEntry.expects(:last).returns(entry)
+ entry.expects(:toggle)
+ resume
+ end
+
+ def test_cancel
+ entry = stub
+ HCl::DayEntry.expects(:with_timer).returns(entry)
+ entry.expects(:cancel).returns(true)
+ cancel
+ end
+
+ def test_note
+ entry = stub
+ HCl::DayEntry.expects(:with_timer).returns(entry)
+ entry.expects(:append_note).with('hi world')
+ note 'hi world'
+ end
+
end