A fork of Crisp for HARP
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.

22 line
558 B

9 年之前
9 年之前
9 年之前
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