spec/spec_support/include_dir_context.rb
def include_dir_context(dir)
      spec_root = File.expand_path("..", __dir__)
      d, steps = dir, []
      while d.size >= spec_root.size
        steps << d
        d = File.join(File.split(d)[0..-2])
      end

      steps.reverse.each do |d|
        begin; include_context d; rescue ArgumentError; end
      end
    end
# Include hierarchical contexts from <tt>spec/</tt> up to spec root.
#
#   describe Something do
#     include_dir_context __dir__
#     ...
Include hierarchical contexts from spec/ up to spec root.
Include hierarchical contexts from spec / up to spec root .
def include_dir_context(dir)
      spec_root = File.expand_path("..", __dir__)
      d, steps = dir, []
      while d.size >= spec_root.size
        steps << d
        d = File.join(File.split(d)[0..-2])
      end
      steps.reverse.each do |d|
        begin; include_context d; rescue ArgumentError; end
      end
    end
def include_dir_context ( dir ) spec_root = File . expand_path ( ".." , __dir__ ) d , steps = dir , [ ] while d . size >= spec_root . size steps << d d = File . join ( File . split ( d ) [ 0 .. - 2 ] ) end steps . reverse . each do | d | begin ; include_context d ; rescue ArgumentError ; end end end
Include hierarchical contexts from <tt>spec/</tt> up to spec root.
Include hierarchical contexts from <tt > spec / < / tt > up to spec root .
dir