Module | MSpec |
In: |
lib/mspec/runner/mspec.rb
lib/mspec/version.rb lib/mspec/matchers/include.rb |
Cannot override include at the toplevel in MRI
VERSION | = | SpecVersion.new "1.5.17" |
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.
Guards can be nested, so a stack is necessary to know when we have exited the toplevel guard.
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
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 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.
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.