module Mocks

Overview

A utility library providing mock functionality. Intended for testing, but can be used anywhere.

Defined in:

mocks.cr
mocks/allow.cr
mocks/anything.cr
mocks/arguments.cr
mocks/arguments_pattern.cr
mocks/call.cr
mocks/call_original_stub.cr
mocks/default_behavior.cr
mocks/double.cr
mocks/dsl.cr
mocks/exception_stub.cr
mocks/lazy_double.cr
mocks/mock.cr
mocks/multi_value_stub.cr
mocks/nil_stub.cr
mocks/null_object.cr
mocks/proc_stub.cr
mocks/proxy.cr
mocks/receive_count_expectation.cr
mocks/receive_count_expectation_modifiers.cr
mocks/receive_expectation.cr
mocks/receive_expectation_modifiers.cr
mocks/registry.cr
mocks/scope.cr
mocks/standard_stubs.cr
mocks/stub.cr
mocks/stub_collection.cr
mocks/stub_modifiers.cr
mocks/stubbable.cr
mocks/stubbable/automatic.cr
mocks/stubbed.cr
mocks/unexpected_message.cr
mocks/value_stub.cr

Constant Summary

VERSION = {{ (`shards version \"/srv/crystaldoc.info/github-icy-arctic-fox-mocks-main/src\"`).stringify.chomp }}

Class Method Summary

Macro Summary

Class Method Detail

def self.disable #

Disables mock functionality. This can be used to disable mock functionality temporarily.


[View source]
def self.enable #

Enables mock functionality. This should be called by the test framework once it is ready.


[View source]
def self.enabled? : Bool #

Indicates whether mock functionality is enabled.


[View source]

Macro Detail

macro fake_value(type) #

Returns a fake value of the specified type. This is used to trick the compiler into inferring a specific type. This macro should only be used where strictly needed, and the value should never be used.


[View source]