rspec/rspec-core — Issue #492: Pending() within before :all block does not stop block's code execution
Author: fantactuka
Created: 2011-10-31 20:04:06+00:00
State: open

Code below will fail with `@user is nil`, since execution is not stopped on `pending`

```ruby
before :all do
pending "Unable to find user" if @user.nil?

visit user_path(@user)
end
```

However `before :each` works as expected

```ruby
before :each do
pending "Unable to find user" if @user.nil?

visit user_path(@user) # Is not executed if @user.nil?
end
```

I've fixed this with code below, but I think pending should stop code execution within before :all as well

```ruby
before :all do
if @user.nil?
pending "Unable to find user"
else
visit user_path(@user)
end
end
```

As per code, when running outside example (within `before :all`) it's not raising Pending exception, but just runs `before :each` with passed pending block