Sha256: d1cb16cc07155e5f85d6a8e34a083d7f135745c845fa7ee0a3ad01779699e5f8
Contents?: true
Size: 1.91 KB
Versions: 2
Compression:
Stored size: 1.91 KB
Contents
# -*- coding: utf-8 -*- require 'minitest/autorun' require 'simplecov' SimpleCov.start require 'sixarm_ruby_numeric_round' describe Float do describe "#ceil_at" do it "works" do 4.555.ceil_at(0).must_equal 5.0 4.555.ceil_at(1).must_equal 4.6 4.555.ceil_at(2).must_equal 4.56 4.555.ceil_at(3).must_equal 4.555 end end describe "#ceil_to" do it "works" do 4.555.ceil_to(1).must_equal 5.0 4.555.ceil_to(0.1).must_equal 4.6 4.555.ceil_to(0.01).must_equal 4.56 4.555.ceil_to(0).must_equal 4.555 end end describe "#floor_at" do it "works" do 4.555.floor_at(0).must_equal 4.0 4.555.floor_at(1).must_equal 4.5 4.555.floor_at(2).must_equal 4.55 4.555.floor_at(3).must_equal 4.555 end end describe "#floor_to" do it "works" do 4.555.floor_to(1).must_equal 4.0 4.555.floor_to(0.1).must_equal 4.5 4.555.floor_to(0.01).must_equal 4.55 4.555.floor_to(0).must_equal 4.555 end end describe "#round_at" do it "works" do 4.555.round_at(0).must_equal 5.0 4.555.round_at(1).must_equal 4.6 4.555.round_at(2).must_equal 4.56 4.555.round_at(3).must_equal 4.555 end end describe "#round_to" do it "works" do 4.555.round_to(1).must_equal 5 4.555.round_to(0.1).must_equal 4.6 4.555.round_to(0.01).must_equal 4.56 4.555.round_to(0).must_equal 4.555 end end describe "#truncate_at" do it "works" do 4.555.truncate_at(0).must_equal 4.0 4.555.truncate_at(1).must_equal 4.5 4.555.truncate_at(2).must_equal 4.55 4.555.truncate_at(3).must_equal 4.555 end end describe "#truncate_to" do it "works" do 4.555.truncate_to(1).must_equal 4.0 4.555.truncate_to(0.1).must_equal 4.5 4.555.truncate_to(0.01).must_equal 4.55 4.555.truncate_to(0).must_equal 4.555 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sixarm_ruby_numeric_round-1.0.2 | test/sixarm_ruby_numeric_round_test.rb |
sixarm_ruby_numeric_round-1.0.1 | test/sixarm_ruby_numeric_round_test.rb |