diff options
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 |
