Chervil is a toy Lisp interpreter written in Ruby
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

identifier_spec.rb 331B

123456789101112
  1. module Chervil
  2. RSpec.describe AST::Identifier do
  3. it 'evaluates' do
  4. env = Env.new
  5. identifier = AST::Identifier.new("x")
  6. value = AST::Number.new(5.0)
  7. definition = AST::Definition.new(identifier, value)
  8. definition.evaluate(env)
  9. expect(identifier.evaluate(env)).to eq(value)
  10. end
  11. end
  12. end