Sha256: d4c373dc9c76f73fe08e275719228c01c4ba272abd4ff3bc45bbe4dac80a10a3

Contents?: true

Size: 442 Bytes

Versions: 1

Compression:

Stored size: 442 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 "returns a numeric in opal" do
    rand.should be_kind_of(Numeric)
    rand(77).should be_kind_of(Numeric)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-0.11.0.rc1 spec/opal/core/kernel/rand_spec.rb