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.

constant_spec.rb 441B

12345678910111213141516171819
  1. module Chervil
  2. RSpec.describe AST::Boolean do
  3. it 'evaluates' do
  4. expect(AST::Boolean.new(true).evaluate(Env.new)).to eq(true)
  5. end
  6. end
  7. RSpec.describe AST::Number do
  8. it 'evaluates' do
  9. expect(AST::Number.new(5.0).evaluate(Env.new)).to eq(5.0)
  10. end
  11. end
  12. RSpec.describe AST::String do
  13. it 'evaluates' do
  14. expect(AST::String.new("hello world").evaluate(Env.new)).to eq("hello world")
  15. end
  16. end
  17. end