A fork of Crisp for HARP
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

22 rindas
558 B

pirms 9 gadiem
pirms 9 gadiem
pirms 9 gadiem
pirms 9 gadiem
pirms 9 gadiem
  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