Improve exceptions usage in specs:

* Throw symbols instead of raising exceptions to test code evaluation,
  this will reduce "bad" usages of exceptions, symbols seems a little
  better for now;
* Add a specific exception to be used in specs for testing behaviour
  when an exception is raised from a recipe.
This commit is contained in:
Thibault Jouan
2013-08-01 23:13:24 +00:00
parent c3737e738e
commit d677c3aa97
5 changed files with 21 additions and 13 deletions

View File

@@ -2,3 +2,8 @@ require 'producer/core'
require 'support/exit_helpers'
require 'support/fixtures_helpers'
# Specific error thrown in the error fixture recipe, we can't define it in the
# recipe, rspec wouldn't know about it.
SomeErrorInRecipe = Class.new(RuntimeError)