Class Spec::Example::ExampleGroupProxy

  1. lib/spec/example/example_group_proxy.rb
Parent: Object

Lightweight proxy for an example group. This is the object that is passed to Spec::Runner::Formatter::BaseFormatter#example_group_started

Methods

public instance

  1. backtrace
  2. filtered_description

Attributes

description [R] This is the description passed to the describe() method or any of its aliases
examples [R] A collection of ExampleGroupProxy objects, one for each example declared in this group.
location [R] The file and line number at which the proxied example group was declared. This is extracted from caller, and is therefore formatted as an individual line in a backtrace.
nested_descriptions [R] Used by Spec::Runner::Formatter::NestedTextFormatter to access the description of each example group in a nested group separately.
options [R] Optional hash passed to the example group declaration. Note that RSpec uses this hash internally and reserves the keys :location and :scope for its own use (and removes them from this hash)

Public instance methods

backtrace ()

Deprecated - use location() instead

[show source]
# File lib/spec/example/example_group_proxy.rb, line 41
      def backtrace
        Spec::deprecate("ExampleGroupProxy#backtrace","ExampleGroupProxy#location")
        @backtrace
      end
filtered_description (regexp)

Deprecated - just use gsub on the description instead.

[show source]
# File lib/spec/example/example_group_proxy.rb, line 47
      def filtered_description(regexp)
        Spec::deprecate("ExampleGroupProxy#filtered_description","gsub (or similar) to modify ExampleGroupProxy#description")
        ExampleGroupMethods.build_description_from(
          *nested_descriptions.collect do |description|
            description =~ regexp ? description.gsub($1, "") : description
          end
        )
      end