Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Super-dirty PoC: skip including shared example from unrelated contexts #2825

Closed

Conversation

pirj
Copy link
Member

@pirj pirj commented Dec 26, 2020

    RSpec.describe 'root' do
      context 'extra context' do
        shared_examples 'extra', :extra do
          it('extra!'){ }
        end
        context 'inner extra', :extra do
        end
      end

      context 'normal' do
        context 'inner', :extra do
          it('passes'){ }
        end
      end
    end

Before:

root
  extra context
    inner extra
      extra!
  normal
    inner
      extra! <==== we're trying to get rid of this
      passes

After:

root
  extra context
    inner extra
      extra!
  normal
    inner
      passes

    RSpec.describe 'root' do
      context 'extra context' do
        shared_examples 'extra', :extra do
          it('extra!'){ }
        end
        context 'inner extra', :extra do
        end
      end

      context 'normal' do
        context 'inner', :extra do
          it('passes'){ }
        end
      end
    end

Before:

    root
      extra context
        inner extra
          extra!
      normal
        inner
          extra! <==== we're trying to get rid of this
          passes

After:

    root
      extra context
        inner extra
          extra!
      normal
        inner
          passes
@pirj pirj self-assigned this Dec 26, 2020
@pirj pirj closed this Dec 29, 2020
@pirj pirj deleted the skip-including-shared-example-from-unrelated-contexts branch December 29, 2020 23:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant