module Spectator::DSL::Concise

Overview

DSL methods and macros for shorter syntax.

Direct including types

Defined in:

spectator/dsl/concise.cr

Macro Summary

Macro Detail

macro given(*assignments, **kwargs, &block) #

Defines an example and input values in a shorter syntax. The only arguments given to this macro are one or more assignments. The names in the assignments will be available in the example code.

If the code block is omitted, then the example is skipped (marked as not implemented).

Tags and metadata cannot be used with this macro.

provided x = 42, y: 123 do
  expect(x).to eq(42)
  expect(y).to eq(123)
end

DEPRECATED Use provided instead.


[View source]
macro provided(*assignments, it description = nil, **kwargs, &block) #

Defines an example and input values in a shorter syntax. The only arguments given to this macro are one or more assignments. The names in the assignments will be available in the example code.

If the code block is omitted, then the example is skipped (marked as not implemented).

Tags and metadata cannot be used with this macro.

provided x = 42, y: 123 do
  expect(x).to eq(42)
  expect(y).to eq(123)
end

[View source]