class ChefSpec::SoloRunner
def calling_cookbook_root(options, kaller)
-
(String)-
Parameters:
-
kaller(Array) -- -
options(Hash) --
def calling_cookbook_root(options, kaller) calling_spec = options[:spec_declaration_locations] || kaller.find { |line| line =~ %r{/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