This helper library is for writing tests concisely.
You can write a test as follows.
example_with "value is zero", value: 0 { expect(value).to eq 0 }
Above is the same as below.
context "value is zero" do
let(:value) { 0 }
it { expect(value).to eq 0 }
end
That’s basically all there is to it, but I think it will be more potent when used with a custom matcher.
-
Add the dependency to your
shard.yml
:development_dependencies: spectator-context_helper: github: masaakiaoyagi/spectator-context_helper.cr
-
Run
shards install
require "spectator-context_helper"
See spec how to write a test.