def calling_cookbook_root(options, kaller)
      calling_spec = options[:spec_declaration_locations] || kaller.find { |line| line =~ /\/spec/ }
      raise Error::CookbookPathNotFound if calling_spec.nil?

      bits = calling_spec.split(/:[0-9]/, 2).first.split(File::SEPARATOR)
      spec_dir = bits.index('spec') || 0

      File.join(bits.slice(0, spec_dir))
    end
def calling_cookbook_root(options, kaller)
      calling_spec = options[:spec_declaration_locations] || kaller.find { |line| line =~ /\/spec/ }
      raise Error::CookbookPathNotFound if calling_spec.nil?

      bits = calling_spec.split(/:[0-9]/, 2).first.split(File::SEPARATOR)
      spec_dir = bits.index('spec') || 0

      File.join(bits.slice(0, spec_dir))
    end
The inferred cookbook root from the calling spec.

 @param [Hash<Symbol, Object>] options
   initial runner options
 @param [Array<String>] kaller
   the calling trace

 @return [String]