Module: RSpec::SleepingKingStudios::Deferred::Examples::ClassMethods
- Defined in:
- lib/rspec/sleeping_king_studios/deferred/examples.rb
Overview
Class methods for deferred examples.
Instance Attribute Summary collapse
-
#parent_group ⇒ RSpec::SleepingKingStudios::Deferred::Examples
The deferred example group where this example group was included, if any.
-
#source_location ⇒ Array<String, Integer>
The Ruby source filename and line number where the deferred example group was defined.
Instance Method Summary collapse
-
#deferred_examples? ⇒ Boolean
Flag indicating that the included module has deferred examples, rather than including another deferred examples module.
-
#description ⇒ String
The description for the deferred examples.
- #description=(value) ⇒ Object
Instance Attribute Details
#parent_group ⇒ RSpec::SleepingKingStudios::Deferred::Examples
Returns the deferred example group where this example group was included, if any.
14 15 16 |
# File 'lib/rspec/sleeping_king_studios/deferred/examples.rb', line 14 def parent_group @parent_group end |
#source_location ⇒ Array<String, Integer>
Returns the Ruby source filename and line number where the deferred example group was defined.
18 19 20 |
# File 'lib/rspec/sleeping_king_studios/deferred/examples.rb', line 18 def source_location @source_location end |
Instance Method Details
#deferred_examples? ⇒ Boolean
Returns flag indicating that the included module has deferred examples, rather than including another deferred examples module.
40 41 42 |
# File 'lib/rspec/sleeping_king_studios/deferred/examples.rb', line 40 def deferred_examples? true end |
#description ⇒ String
Returns the description for the deferred examples. By default, formats the last segment of the module name in lowercase words, excepting any trailing “Context” or “Examples”.
23 24 25 26 27 28 29 |
# File 'lib/rspec/sleeping_king_studios/deferred/examples.rb', line 23 def description return @description if @description return @description = '(anonymous examples)' if name.nil? @description = format_description end |
#description=(value) ⇒ Object
32 33 34 35 36 |
# File 'lib/rspec/sleeping_king_studios/deferred/examples.rb', line 32 def description=(value) tools.assertions.validate_name(value, as: 'description') @description = value.to_s.tr('_', ' ') end |