test/unit/custom_calculations_test.rb in hqmf2js-1.3.0 vs test/unit/custom_calculations_test.rb in hqmf2js-1.4.0
- old
+ new
@@ -1,9 +1,9 @@
require_relative '../test_helper'
require 'hquery-patient-api'
-class CustomCalculationsTest < Test::Unit::TestCase
+class CustomCalculationsTest < Minitest::Test
def setup
@context = get_js_context(HQMF2JS::Generator::JS.library_functions)
test_initialize_js =
"
@@ -76,11 +76,11 @@
end
def test_inr_results
- @context.eval("typeof(hqmf.CustomCalc.PercentTTREntries) === 'function'").must_equal true
+ assert_equal true, @context.eval("typeof(hqmf.CustomCalc.PercentTTREntries) === 'function'")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr1,inr2) - 3.714285714285717) < .001")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr2,inr3)) == 0 ")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr3,inr4)) == 0")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr4,inr5) - 10.45454545) < .001")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr5,inr6) - 7) < .001")
@@ -90,13 +90,9 @@
assert @context.eval("Math.abs(list.calculateDaysInRange(inr9,inr10)) == 0")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr10,inr11)) == 0")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr11,inr12) - 9.692307692) < .001")
assert @context.eval("Math.abs(list.calculateDaysInRange(inr12,inr13) - 14) < .001")
- end
-
- def test_total_number_of_days
- @context.eval("list.totalNumberOfDays()").must_equal 198
end
def test_calculate_ttr
assert @context.eval("Math.abs(list.calculateTTR() - 87.11113886) < .001")
end