Chervil is a toy Lisp interpreter written in Ruby
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

env_spec.rb 330B

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, 2], env)).to eq(3)
  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