Sha256: d350471f9bd970c631c2292d3b42c9a8b0a0fe3cf0677c73c001254b76ec02d7

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe "Standard Library" do
  describe "rand" do
    before :each do
      @interpreter = Flea::Interpreter.new
    end
    
    10.times do
      it "should return a random number lower than or equal to 10" do
        result = @interpreter.run('(rand 10)')
        result.should < 11
      end
      
      it "should evaluate its arguments" do
        result = @interpreter.run('
          (define a 10)
          (rand a)
        ')
        result.should < 11
      end
    end
  
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flea-0.1.0 spec/flea/standard_library/rand_spec.rb