Sha256: a595f56f707e760550b9d7174f3547c69881561045fd66b182b13d7d0cfc28be
Contents?: true
Size: 463 Bytes
Versions: 24
Compression:
Stored size: 463 Bytes
Contents
RSpec.describe "EitilCore Float#safe_to_i" do it "should convert a float to an integer, if the float is rounded (e.g. 7.0)" do float = 7.0 result = float.safe_to_i expect(result).to eq 7 expect(result).to be_a Integer end it "should not convert a float to an integer, if the float is not rounded (e.g. 7.1)" do float = 7.1 result = float.safe_to_i expect(result).to eq 7.1 expect(result).to be_a Float end end
Version data entries
24 entries across 24 versions & 1 rubygems