Module MSpec
In: lib/mspec/version.rb
lib/mspec/matchers/include.rb
lib/mspec/runner/mspec.rb

Cannot override include at the toplevel in MRI

Methods

Constants

VERSION = SpecVersion.new "1.5.17"

Public Class methods

Sets the toplevel ContextState to nil.

Resets the flag that an expectation has been encountered in an example.

Clears all registered modes.

Returns the toplevel ContextState.

Deletes tag from the tag file if it exists. Returns true if the tag is deleted, false otherwise. Deletes the tag file if it is empty.

Removes the tag file associated with a spec file.

Retrieves the stored exit code.

Records that an expectation has been encountered in an example.

Returns true if an expectation has been encountered

Guards can be nested, so a stack is necessary to know when we have exited the toplevel guard.

Returns true if mode is registered.

Returns a list of tags matching any tag string in keys based on the return value of keys.include?("tag_name")

This method is used for registering actions that are run at particular points in the spec cycle:

  :start        before any specs are run
  :load         before a spec file is loaded
  :enter        before a describe block is run
  :before       before a single spec is run
  :add          while a describe block is adding examples to run later
  :expectation  before a 'should', 'should_receive', etc.
  :example      after an example block is run, passed the block
  :exception    after an exception is rescued
  :after        after a single spec is run
  :leave        after a describe block is run
  :unload       after a spec file is run
  :finish       after all specs are run

Objects registered as actions above should respond to a method of the same name. For example, if an object is registered as a :start action, it should respond to a start method call.

Additionally, there are two "action" lists for filtering specs:

  :include  return true if the spec should be run
  :exclude  return true if the spec should NOT be run

Sets the toplevel ContextState to state.

Stores the exit code used by the runner scripts.

Stores the list of files to be evaluated.

Registers an operating mode. Modes recognized by MSpec:

  :pretend - actions execute but specs are not run
  :verify - specs are run despite guards and the result is
            verified to match the expectation of the guard
  :report - specs that are guarded are reported
  :unguarded - all guards are forced off

Stores the shared ContextState keyed by description.

Stores one or more substitution patterns for transforming a spec filename into a tags filename, where each pattern has the form:

  [Regexp, String]

See also tags_file.

Returns the shared ContextState matching description.

Transforms a spec filename into a tags filename by applying each substitution pattern in :tags_pattern. The default patterns are:

  [%r(/spec/), '/spec/tags/'], [/_spec.rb$/, '_tags.txt']

which will perform the following transformation:

  path/to/spec/class/method_spec.rb => path/to/spec/tags/class/method_tags.txt

See also register_tags_patterns.

Writes tag to the tag file if it does not already exist. Returns true if the tag is written, false otherwise.

Writes each tag in tags to the tag file. Overwrites the tag file if it exists.

Public Instance methods

[Validate]