Sha256: 9b7868b895eb9808911e39e2cdc6073f4a8c58ff4f84672ffc156d0c9cae7147

Contents?: true

Size: 510 Bytes

Versions: 5

Compression:

Stored size: 510 Bytes

Contents

---
title: Underscore sugar
inMenu: true
---
h2. Underscore sugar

The internal implementation of RSpec actually uses chained method calls, so it's possible
to write:

<ruby>
lambda { 1.should.not.equal 1 }.should.raise
</ruby>

However, in order to make RSpec look and feel closer to other ruby code,
RSpec allows you to use underscores instead if you wish:

<ruby>
lambda { 1.should_not_equal 1 }.should_raise
</ruby>

Therefore, you will see the underscored syntax throughout the documentation and examples.

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-0.5.10 doc/src/documentation/underscores.page
rspec-0.5.11 doc/src/documentation/underscores.page
rspec-0.5.7 doc/src/documentation/underscores.page
rspec-0.5.8 doc/src/documentation/underscores.page
rspec-0.5.9 doc/src/documentation/underscores.page