Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.73 KB

README.adoc

File metadata and controls

53 lines (40 loc) · 1.73 KB

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