[rspec-users] Does rspec support something like Assumptions in JUnit 4.4?

mortench mortench at gmail.com
Mon Jun 1 06:33:00 EDT 2009

JUnit 4.4+ has a feature called assumptions and I am looking for
something similar in rspec so that I can express that my examples
require a specific environment variable to be specified for testing to
make sense.

About assumptions from the readme (http://junit.sourceforge.net/doc/
"Ideally, the developer writing a test has control of all of the
forces that might cause a test to fail. If this isn't immediately
possible, making dependencies explicit can often improve a design.
For example, if a test fails when run in a different locale than the
developer intended, it can be fixed by explicitly passing a locale to
the domain code.

However, sometimes this is not desirable or possible.
It's good to be able to run a test against the code as it is currently
written, implicit assumptions and all, or to write a test that exposes
a known bug. For these situations, JUnit now includes the ability to
express "assumptions":


More information about the rspec-users mailing list