From 5d9a5f1f57cd679ec656d3e327146b252b4d755d Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 6 Aug 2013 17:13:41 +0000 Subject: [PATCH] Simplify spec helper: Move specific exception `SomeErrorInRecipe' in the only spec where it is used. --- spec/producer/core/recipe/dsl_spec.rb | 4 ++++ spec/spec_helper.rb | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spec/producer/core/recipe/dsl_spec.rb b/spec/producer/core/recipe/dsl_spec.rb index 4c42fae..0193030 100644 --- a/spec/producer/core/recipe/dsl_spec.rb +++ b/spec/producer/core/recipe/dsl_spec.rb @@ -4,6 +4,10 @@ module Producer::Core describe Recipe::DSL do include FixturesHelpers + # 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) + let(:code) { proc { } } let(:env) { double('env').as_null_object } subject(:dsl) { Recipe::DSL.new &code } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b96e18e..95f6163 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,8 +2,3 @@ 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)