Sha256: 1fdf31860aa298e10b40858ac466860c14965e8501df2954629433dd930b6ad1
Contents?: true
Size: 540 Bytes
Versions: 48
Compression:
Stored size: 540 Bytes
Contents
describe "Kernel.rand" do it "returns a float if no argument is passed" do rand.should be_kind_of(Float) end it "returns an integer for an integer argument" do rand(77).should be_kind_of(Integer) end it "return member from range" do r = (1..10) r.to_a.include?(rand(r)).should == true end it "should convert negative number and convert to integer" do rand(-0.1).should == 0 end it "returns a numeric in opal" do rand.should be_kind_of(Numeric) rand(77).should be_kind_of(Numeric) end end
Version data entries
48 entries across 48 versions & 3 rubygems