Sha256: 97172661c844d5817d3d5f9962ae52e4fa8de90dd4183b5ec326baae51daaa15
Contents?: true
Size: 1.64 KB
Versions: 6
Compression:
Stored size: 1.64 KB
Contents
# Always Execute - Change the way you test! Always Execute extends [RSpec](http://rspec.info) or [Shoulda](https://github.com/thoughtbot/shoulda) by adding an execute block, which is the natural home for the actual code you are testing. Why would you ever need that? The answer is simple, the execute block provides a clear separation of concerns in your test structure making it easier to read and write. All good tests have 3 separate and equally important steps: 1. **_Setup_** the environment in a known state 2. **_Execute_** the code you want to test 3. **_Assert_** that your code changed the environment in the way you expected Both RSpec and Shoulda by default provide blocks to encapsulate the **_setup_** and **_assert_** steps with the `before` / `setup` and `it` / `should` blocks, but there is no built-in block for the **_execute_** step. This leads to muddled blocks for your assertions that often contain bits of **_setup_**, **_execute_**, and **_assert_** code, making the test difficult to understand. Checkout the examples: * [RSpec Examples](http://github.com/michaelgpearce/always_execute/blob/master/docs/rspec_examples.md) * [Shoulda Examples](http://github.com/michaelgpearce/always_execute/blob/master/docs/shoulda_examples.md) # Credits Always Execute was developed by [Michael Pearce](http://github.com/michaelgpearce) in conjunction with [Philippe Huibonhoa](http://github.com/phuibonhoa) and is funded by [Rafter](http://www.rafter.com "Rafter").  # Copyright Copyright (c) 2011-2012 Michael Pearce, Rafter.com. See LICENSE.txt for further details.
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
always_execute-0.2.3 | README.md |
always_execute-0.2.2 | README.md |
always_execute-0.2.1 | README.md |
always_execute-0.2.0 | README.md |
always_execute-0.1.3 | README.md |
always_execute-0.1.2 | README.md |