diff options
| author | Zack Hobson | 2009-08-23 21:22:04 -0700 | 
|---|---|---|
| committer | Zack Hobson | 2009-08-23 21:22:04 -0700 | 
| commit | 3cb1969adcb82a81458b474c350d6045626d4ac2 (patch) | |
| tree | dda7352de1d287981b06001204c6418eb3dd82a3 /test/utility_test.rb | |
| parent | d82f777ee4e3e89cfab56afb92297a6330dd8199 (diff) | |
| download | hcl-3cb1969adcb82a81458b474c350d6045626d4ac2.tar.bz2 | |
Allow start +decimal input without a dot, closes #29.
Diffstat (limited to 'test/utility_test.rb')
| -rw-r--r-- | test/utility_test.rb | 17 | 
1 files changed, 17 insertions, 0 deletions
diff --git a/test/utility_test.rb b/test/utility_test.rb new file mode 100644 index 0000000..1435d97 --- /dev/null +++ b/test/utility_test.rb @@ -0,0 +1,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  | 
