You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warn if a fixture method is called from a before(:context) block.
Fixes#1442.
The basic approach here is to capture the addition of the fixture
methods to the example group instance and then monkeypatch them. The
monkeypatch checks to see if we're currently in a before(:context) hook
and if we are then it prints a warning and doesn't invoke the method.
The warning here is a little sparse at the moment, and I'd like to make
it more clear. One thing that's a little gross about this implementation
is that it uses the inspect string of the example group to determine if
we're in a before(:context) hook. As far as I can tell there isn't a
better way to make that determination, but maybe someone's got a clever
trick.
0 commit comments