Testing with Spec



spec/spec_helper.cr
require "spec"

spec/demo_spec.cr
require "./spec_helper"

describe "demo test" do
  it "some free text here" do
    result = 23 + 19 # this might be calling the real application
    result.should eq 42
  end
end

spec/todo_spec.cr
def add(x, y)
  return x*y
end

describe "test cases" do
  it "good" do
    add(2, 2).should eq 4
  end

  pending "add" do
    add(2, 3).should eq 5
  end
  pending "add" do
    add(2, 4).should eq 6
  end
end

crystal spec