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.

definition_spec.rb 278B

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