A fork of Crisp for HARP
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
558 B

9 년 전
9 년 전
  1. require "../helper"
  2. describe "Crisp::Interpreter" do
  3. describe "#eval_string" do
  4. it "evaluates string of Crisp expression" do
  5. i = Crisp::Interpreter.new
  6. result = i.eval_string "(+ 1 2)"
  7. result.should be_a(Crisp::Type)
  8. unwrapped = result.unwrap
  9. unwrapped.should be_a(Int32)
  10. unwrapped.should eq(3)
  11. end
  12. end
  13. describe "#run" do
  14. it "raises eval error with file which doesn't exist" do
  15. expect_raises Crisp::EvalException do
  16. Crisp::Interpreter.new "/non/existent/file"
  17. end
  18. end
  19. end
  20. end