class GeneratorSpec::Matcher::Root

def description

def description
  'have specified directory structure'
end

def failure_message

def failure_message
  if @failure.is_a?(Array) && @failure[0] == :not
    if @failure.length > 2
      "Structure should have #{@failure[1]} without #{@failure[2]}. It had:\n#{@failure[3]}"
    else
      "Structure should not have had #{@failure[1]}, but it did"
    end
  elsif @failure.is_a?(Array)
    "Structure should have #{@failure[0]} with #{@failure[1]}. It had:\n#{@failure[2]}"
  else
    "Structure should have #{@failure}, but it didn't"
  end
end

def matches?(root)

def matches?(root)
  root = Pathname.new(root) unless root.is_a?(Pathname)
  @failure = catch :failure do
    super
  end
  !@failure
end