jnicklas/turnip — pull request #137 by gongo (2014-07-29 13:11:36+00:00)
Title: Catch ExpectationNotMetError explicitly on RSpec 3

From RSpec 3 + Turnip, the following differences began to appear.

**RSpec 2.14 + Turnip 1.2.2**:

```
$ bundle exec rspec examples/errors.feature:8
Run options: include {:locations=>{"./examples/errors.feature"=>[8]}}
F

Failures:

1) raises errors Incorrect expectation there is a monster -> it should die
Failure/Error: Then it should die

expected: 0
got: 1

(compared using ==)
# ./examples/steps/steps.rb:14:in `block in '
# ./lib/turnip/execute.rb:20:in `step'
# ./lib/turnip/rspec.rb:44:in `run_step'
# ./examples/errors.feature:8:in `block (6 levels) in run'
# ./examples/errors.feature:7:in `each'
# ./examples/errors.feature:7:in `block (5 levels) in run'
# ./examples/errors.feature:8:in `it should die'
```

**RSpec 3 + Turnip 1.2.2**:

```
$ bundle exec rspec examples/errors.feature:8
Run options: include {:locations=>{"./examples/errors.feature"=>[8]}}
F

Failures:

1) raises errors Incorrect expectation there is a monster -> it should die
Failure/Error: Then it should die

expected: 0
got: 1

(compared using ==)
# ./examples/steps/steps.rb:14:in `block in '
# ./lib/turnip/execute.rb:20:in `step'
# ./lib/turnip/rspec.rb:44:in `run_step'
# ./examples/errors.feature:8:in `block (6 levels) in run'
# ./examples/errors.feature:7:in `each'
# ./examples/errors.feature:7:in `block (5 levels) in run'
```

diff:

```diff
# ./examples/errors.feature:8:in `block (6 levels) in run'
# ./examples/errors.feature:7:in `each'
# ./examples/errors.feature:7:in `block (5 levels) in run'
- # ./examples/errors.feature:8:in `it should die
```

## Cause

`RSpec::Expectations::ExpectationNotMetError` is not subclass of `StandardError` from RSpec 3.

see:

- [rspec-expectations v2.14.5](https://github.com/rspec/rspec-expectations/blob/v2.14.5/lib/rspec/expectations/errors.rb#L4-L6)
- [rspec-expectations v3.0.3](https://github.com/rspec/rspec-expectations/blob/v3.0.3/lib/rspec/expectations.rb#L66)