diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/command_test.rb | 5 | ||||
| -rw-r--r-- | test/utility_test.rb | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/test/command_test.rb b/test/command_test.rb index 8536286..94ff673 100644 --- a/test/command_test.rb +++ b/test/command_test.rb @@ -31,11 +31,6 @@ class CommandTest < HCl::TestCase assert_equal "taco.time: now\n", standard_output end - def test_log_failure - HCl::DayEntry.expects(:with_timer).returns(stub) - assert_raises(HCl::CommandError) { log "stuff" } - end - def test_tasks FileUtils.rm_rf ENV['HCL_DIR']+"/cache" register_uri(:get, '/daily', {:day_entries=>[], :projects=> [{ diff --git a/test/utility_test.rb b/test/utility_test.rb index b0fb09c..222d129 100644 --- a/test/utility_test.rb +++ b/test/utility_test.rb @@ -24,6 +24,14 @@ class UtilityTest < HCl::TestCase assert_equal 0.25, get_starting_time(%w[ @taco +.25 makin tacos ]) end + def test_get_date_without_ident + assert_nil get_date(%w[ yesterday +2 no task ]) + end + + def test_get_date_with_ident + assert_equal Chronic.parse('2018-01-15'), get_date(%w[ january 15 2018 @taco +.30 makin tacos ]) + end + def test_time2float_decimal assert_equal 2.5, time2float("2.5") end |
