Spec - Crystal 1.11.2

# module Spec

##
Defined in:

spec/cli.cr
spec/context.cr
spec/dsl.cr
spec/example.cr
spec/example/procsy.cr
spec/example_group/procsy.cr
spec/expectations.cr
spec/filters.cr
spec/formatter.cr
spec/item.cr
spec/junit_formatter.cr
spec/source.cr

##
Class Method Summary

- .add_formatter(formatter)
- .add_split_filter(filter)
- .after_each(&block)

  Instructs the spec runner to execute the given block after each spec in the spec suite.

- .after_suite(&block)

  Instructs the spec runner to execute the given block after the entire spec suite.

- .around_each(&block : Example::Procsy -> )

  Instructs the spec runner to execute the given block when each spec in the spec suite runs.

- .before_each(&block)

  Instructs the spec runner to execute the given block before each spec in the spec suite.

- .before_suite(&block)

  Instructs the spec runner to execute the given block before the entire spec suite.

- .finish_run
- .override_default_formatter(formatter)
- .randomizer : Random::PCG32 | Nil

##
Class Method Detail

def self.add_formatter(formatter) #
def self.add_split_filter(filter) #
def self.after_each(&block) #

Instructs the spec runner to execute the given block after each spec in the spec suite.

If multiple blocks are registered they run in the reversed order that they are given.

For example:

    Spec.after_each { puts 1 }
    Spec.after_each { puts 2 }

will print, just after each spec, 2 and then 1.

def self.after_suite(&block) #

Instructs the spec runner to execute the given block after the entire spec suite.

If multiple blocks are registered they run in the reversed order that they are given.

For example:

    Spec.after_suite { puts 1 }
    Spec.after_suite { puts 2 }

will print, just after the spec suite ends, 2 and then 1.

def self.around_each(&block : Example::Procsy -> ) #

Instructs the spec runner to execute the given block when each spec in the spec suite runs.

The block must call `run` on the given `Example::Procsy` object.

If multiple blocks are registered they run in the reversed order that they are given.

    require "spec"

    Spec.around_each do |example|
      puts "runs before each sample"
      example.run
      puts "runs after each sample"
    end

    it { }
    it { }

def self.before_each(&block) #

Instructs the spec runner to execute the given block before each spec in the spec suite.

If multiple blocks are registered they run in the order that they are given.

For example:

    Spec.before_each { puts 1 }
    Spec.before_each { puts 2 }

will print, just before each spec, 1 and then 2.

def self.before_suite(&block) #

Instructs the spec runner to execute the given block before the entire spec suite.

If multiple blocks are registered they run in the order that they are given.

For example:

    Spec.before_suite { puts 1 }
    Spec.before_suite { puts 2 }

will print, just before the spec suite starts, 1 and then 2.

def self.finish_run #
def self.override_default_formatter(formatter) #
def self.randomizer : Random::PCG32 | Nil #