summaryrefslogtreecommitdiffstats
path: root/test/utility_test.rb
blob: 1435d974e07ef4edc0dc246c84f0a74d70d26d62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'test_helper'

class UtilityTest < Test::Unit::TestCase
  include HCl::Utility

  should "convert decimal input when converting time2float" do
    assert_equal 2.5, time2float("2.5")
  end

  should "convert HH:MM input when converting time2float" do
    assert_equal 2.5, time2float("2:30")
  end

  should "assume decimal input when converting time2float" do
    assert_equal 2.0, time2float("2")
  end
end