Sha256: 5e8b4622b184d2f9349402a41a0a3134cf9fa582c18e446bbed4a108b5febd0e

Contents?: true

Size: 542 Bytes

Versions: 1

Compression:

Stored size: 542 Bytes

Contents

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

describe "Standard Library" do
  describe "subtraction operator" do
    before :each do
      @interpreter = Flea::Interpreter.new
    end
    
    it "should subtract several numbers" do
      result = @interpreter.run('(- 9 2 2)')
      result.should == 5
    end
    
    it "should evaluate its arguments before subtracting them" do
      result = @interpreter.run('
        (define a 2)
        (define b 9)
        (- b a a)
      ')
      result.should == 5
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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