Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeforeAll runs for examples outside of focus #275

Open
cbandy opened this issue Aug 6, 2022 · 0 comments
Open

BeforeAll runs for examples outside of focus #275

cbandy opened this issue Aug 6, 2022 · 0 comments

Comments

@cbandy
Copy link

cbandy commented Aug 6, 2022

When I run the following spec file with shellspec -c . -F I see that both hooks run even though a single group has focus.

Is this intentional? Is there something I can or should do in my hooks to no-op outside of focus?

$ shellspec --version
0.28.1

$ shellspec -c . -F
** hook one **
** hook two **
Running: /bin/sh [sh]
.

Finished in 0.08 seconds (user 0.05 seconds, sys 0.04 seconds)
1 example, 0 failures


Notable examples: (Listed here do not affect your suite's status)

shellspec hook_spec.sh:16 # -) outer inner2 <example:16-19> 
# hook_spec.sh
hook_one() { echo '** hook one **'; }
hook_two() { echo '** hook two **'; }

Describe 'outer'
  Describe 'inner1'
    BeforeAll 'hook_one'
    Specify
      When call :
      The status should be success
    End
  End

  fDescribe 'inner2'
    BeforeAll 'hook_two'
    Specify
      When call :
      The status should be success
    End
  End
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant