Sha256: 4e5d06b38d0e3a65e634d464865b04909669c53884c2f89e57be763ea39902ec
Contents?: true
Size: 506 Bytes
Versions: 18
Compression:
Stored size: 506 Bytes
Contents
require 'test_helper' describe Unitwise::Functional do subject { Unitwise::Functional } %w{cel degf hpX hpC tan100 ph ld ln lg 2lg}.each do |function| describe function do it 'should convert back and forth' do number = rand(1000) / 1000.0 there = subject.send "to_#{function}", number back_again = subject.send "from_#{function}", there rounded_result = (back_again * 1000).round / 1000.0 rounded_result.must_equal number end end end end
Version data entries
18 entries across 18 versions & 2 rubygems