Sha256: 5c6cbbf59a3c7d98432c3554f556889f14ea0357c79fef6eb9b933ec2a985537

Contents?: true

Size: 524 Bytes

Versions: 1

Compression:

Stored size: 524 Bytes

Contents

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

describe "Standard Library" do
  describe "multiplication operator" do
    before :each do
      @interpreter = Flea::Interpreter.new
    end
    
    it "should multiply several numbers" do
      result = @interpreter.run('(* 2 2 2)')
      result.should == 8
    end
    
    it "should evaluate its arguments before multiplying them" do
      result = @interpreter.run('
        (define a 2)
        (* a a a)
      ')
      result.should == 8
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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