Class | RSpec::Core::Metadata |
In: |
lib/rspec/core/metadata.rb
|
Parent: | Hash |
Each ExampleGroup class and Example instance owns an instance of Metadata, which is Hash extended to support lazy evaluation of values associated with keys that may or may not be used by any example or group.
In addition to metadata that is used internally, this also stores user-supplied metadata, e.g.
describe Something, :type => :ui do it "does something", :slow => true do # ... end end
`:type => :ui` is stored in the Metadata owned by the example group, and `:slow => true` is stored in the Metadata owned by the example. These can then be used to select which examples are run using the `—tag` option on the command line, or several methods on `Configuration` used to filter a run (e.g. `filter_run_including`, `filter_run_excluding`, etc).
@see Example#metadata @see ExampleGroup.metadata @see FilterManager @see Configuration#filter_run_including @see Configuration#filter_run_excluding
RESERVED_KEYS | = | [ :description, :example_group, :execution_result, :file_path, :full_description, :line_number, :location |