Class: Object

Inherits:
BasicObject
Defined in:
lib/riot.rb

Overview

A little bit of monkey-patch so we can have context available anywhere.

Instance Method Summary (collapse)

Instance Method Details

- (Context) context(description, context_class = Riot::Context, &definition) Also known as: describe

Defining context in Object itself lets us define a root context in any file. Any context defined within a context is already handled by Riot::Context#context.

Parameters:

  • description (String)

    the description of this context

  • context_class (Class) (defaults to: Riot::Context)

    the Riot::Context implementation to use

  • &definition (lambda)

    the context definition

Returns:



141
142
143
# File 'lib/riot.rb', line 141

def context(description, context_class = Riot::Context, &definition)
  Riot.context(description, context_class, &definition)
end