Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8027: added_tests_to_test_number_with_precision.diff

File added_tests_to_test_number_with_precision.diff, 0.7 kB (added by lau, 2 years ago)

Adds asserts to the unit test of test_number_with_precision that fails under at least some compilations of ruby on OSX and a version of cygwin on Windows.

  • actionpack/test/template/number_helper_test.rb

    old new  
    6060    assert_equal("111.235", number_with_precision("111.2346")) 
    6161    assert_equal("112", number_with_precision(111.50, 0)) 
    6262    assert_equal("1234567892", number_with_precision(1234567891.50, 0)) 
     63    assert_equal("31.13", number_with_precision(31.125, 2)) 
     64    assert_equal("8.13", number_with_precision(8.125, 2)) 
    6365 
    6466    # Return non-numeric params unchanged. 
    6567    assert_equal("x", number_with_precision("x"))