It's about getting the test setup as close to the relevant test as possible for the sake of the reader. While they could be defined at the top of the file, this would spread out the test setup across the whole file. 


I could even get away with putting them in the before block in another nested describe. It would add a little more code but wrap the whole test and setup in a slightly neater and therefore perhaps more understandable package.

On Fri, Mar 28, 2014 at 12:26 AM, Chris Johnson <notifications@github.com>
wrote:

>> @@ -0,0 +1,97 @@
>> +require 'spec_helper'
>> +
>> +
>> +module Fog
>> +  module Identity
>> +    def self.require(*args); end
>> +  end
>> +end
> I've never seen module declarations inside of a spec like this. What inspired/possessed you to take such an approach? Or have I just been living a sheltered life? ;-)
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/fog/fog-core/pull/30/files#r11054960