Skip to content

masaakiaoyagi/spectator-context_helper.cr

Repository files navigation

Spectator::ContextHelper

stability-wip test License: MIT Conventional Commits

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.

Installation

  1. Add the dependency to your shard.yml:

    development_dependencies:
      spectator-context_helper:
        github: masaakiaoyagi/spectator-context_helper.cr
  2. Run shards install

Usage

require "spectator-context_helper"

See spec how to write a test.

Development

Run tests

$ docker compose run --rm 1.4 crystal spec

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published