Sha256: 4f487ccc3fcf6dfc8cf705543b67450ef731824e1be65d5e14eb018593e228d0

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 Bytes

Contents

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

describe "Standard Library" do
  describe "less-than?" do
    before :each do
      @interpreter = Flea::Interpreter.new
    end
    
    it "return true if it's first argument is smaller than all the others" do
      result = @interpreter.run('(less-than? 5 10 15 20)')
      result.should == true
    end
    
    it "return false if it's first argument is not smaller than all the others" do
      result = @interpreter.run('(less-than? 10 1 2 3 45)')
      result.should == false
    end
    
    it "should evaluate its arguments" do
      result = @interpreter.run('
        (define a 2)
        (define b 10)
        (less-than? b a a)
      ')
      result.should == false
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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