Sha256: 4cb4c544a506af78be2ef507b714a029e92e1f34a3b7d16a377be9324ff5f10c

Contents?: true

Size: 1.35 KB

Versions: 12

Compression:

Stored size: 1.35 KB

Contents

Feature: aliasing

  `describe` and `context` are the default aliases for `example_group`. You can
  define your own aliases for `example_group` and give those custom aliases
  default metadata.

  RSpec provides a few built-in aliases:

    * `xdescribe` and `xcontext` add `:skip` metadata to the example group in
      order to temporarily disable the examples.
    * `fdescribe` and `fcontext` add `:focus` metadata to the example group in
      order to make it easy to temporarily focus the example group (when
      combined with `config.filter_run :focus`.)

  Scenario: Custom example group aliases with metadata
    Given a file named "nested_example_group_aliases_spec.rb" with:
    """ruby
    RSpec.configure do |c|
      c.alias_example_group_to :detail, :detailed => true
    end

    RSpec.detail "a detail" do
      it "can do some less important stuff" do
      end
    end

    RSpec.describe "a thing" do
      describe "in broad strokes" do
        it "can do things" do
        end
      end

      detail "something less important" do
        it "can do an unimportant thing" do
        end
      end
    end
    """
    When I run `rspec nested_example_group_aliases_spec.rb --tag detailed -fdoc`
    Then the output should contain:
      """
      a detail
        can do some less important stuff

      a thing
        something less important
      """

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
opal-rspec-1.1.0.alpha3 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-1.1.0.alpha2 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-1.1.0.alpha1 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-1.0.0 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-1.0.0.alpha1 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-0.8.0 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-0.8.0.alpha3 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-0.8.0.alpha2 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-0.8.0.alpha1 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-0.7.1 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-0.7.0 rspec-core/upstream/features/example_groups/aliasing.feature
opal-rspec-0.7.0.rc.2 rspec-core/upstream/features/example_groups/aliasing.feature