# File lib/generator_spec/matcher.rb, line 71 def directory(name, &block) @tree[name] = block_given? && Directory.new(location(name), &block) end
# File lib/generator_spec/matcher.rb, line 75 def file(name, &block) @tree[name] = File.new(location(name), &block) end
# File lib/generator_spec/matcher.rb, line 83 def location(name) [@root, name].compact.join("/") end
# File lib/generator_spec/matcher.rb, line 91 def matches?(root) @tree.each do |file, value| unless value unless root.join(location(file)).exist? throw :failure, "#{root}/#{location(file)}" end else value.matches?(root) end end @negative_tree.each do |file| if root.join(location(file)).exist? throw :failure, [:not, "unexpected #{root}/#{location(file)}"] end end nil end
Generated with the Darkfish Rdoc Generator 2.