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.

env_spec.rb 336B

123456789101112131415
  1. module Chervil
  2. RSpec.describe Env do
  3. it 'has arithmetic from core' do
  4. env = Env.new
  5. expect(env.get('+').call([1.0, 2.0], env)).to eq(3.0)
  6. end
  7. it 'inherits from parent env' do
  8. parent = Env.new
  9. parent.set('x', 5)
  10. child = Env.new(parent)
  11. expect(child.get('x')).to eq(5)
  12. end
  13. end
  14. end