Module: Spec::Example::ModuleReopeningFix

Included in:
ExampleMethods
Defined in:
lib/gems/rspec-1.1.12/lib/spec/example/module_reopening_fix.rb

Overview

This is a fix for …Something in Ruby 1.8.6??… (Someone fill in here please - Aslak)

Instance Method Summary collapse

Instance Method Details

#child_modulesObject



5
6
7
# File 'lib/gems/rspec-1.1.12/lib/spec/example/module_reopening_fix.rb', line 5

def child_modules
  @child_modules ||= []
end

#include(mod) ⇒ Object



13
14
15
16
17
18
# File 'lib/gems/rspec-1.1.12/lib/spec/example/module_reopening_fix.rb', line 13

def include(mod)
  super
  child_modules.each do |child_module|
    child_module.__send__(:include, mod)
  end
end

#included(mod) ⇒ Object



9
10
11
# File 'lib/gems/rspec-1.1.12/lib/spec/example/module_reopening_fix.rb', line 9

def included(mod)
  child_modules << mod
end