0.01
No release in over 3 years
Low commit activity in last 3 years
Adds execute and expect test blocks for added BDD test clarity.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.12.1
~> 0
~> 2.9.0
= 3.1.1
 Project Readme

Always Execute - Change the way you test!

Always Execute extends RSpec or 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:

Credits

Always Execute was developed by Michael Pearce in conjunction with Philippe Huibonhoa and is funded by Rafter.

Rafter Logo

Copyright

Copyright (c) 2011-2012 Michael Pearce, Rafter.com. See LICENSE.txt for further details.