class FitnesseRoot

The FitnesseRoot class represents an entire tree of Fitnesse tests/suites. @attr_reader [Pathname] path The root path of the Fitnesse tree. @attr_reader [Array<String>] blacklist An array of names that should be ignored during the initial tree inspection.

Constants

STANDARD_BLACKLIST

Attributes

blacklist[R]
path[R]

Public Class Methods

new(path, blacklist = STANDARD_BLACKLIST) click to toggle source
# File lib/fitquery/fitnesse_root.rb, line 13
def initialize(path, blacklist = STANDARD_BLACKLIST)
  @path = Pathname.new(path)
  @blacklist = blacklist
  @root_node = FitnesseNode.new(self, self, :root)
end

Public Instance Methods

each(&block) click to toggle source
# File lib/fitquery/fitnesse_root.rb, line 44
def each(&block)
  @root_node.traverse(:pre, &block)
end
find(&block) click to toggle source
# File lib/fitquery/fitnesse_root.rb, line 48
def find(&block)
  @root_node.find(&block)
end
find_name(name, sep = File::SEPARATOR) click to toggle source
# File lib/fitquery/fitnesse_root.rb, line 52
def find_name(name, sep = File::SEPARATOR)
  name_as_array = case name
                    when Array then
                      name
                    when String then
                      name.split(sep)
                    when Pathname then
                      name.to_s.split(File::SEPARATOR)
                    else
                      raise ArgumentError.new("Name must be an Array, String, or Pathname. Was #{name.class}.")
                  end
  find {|node|
    next if node.root?
    full_name = node.path_as_array
    return node if full_name == name_as_array
    Find.prune unless (full_name - name_as_array).empty?
  }
end
print_summary() click to toggle source

Print a summary of the entire tree, indicating types, skipped status, and effective tags on each node.

traverse(order = :pre, &block) click to toggle source
# File lib/fitquery/fitnesse_root.rb, line 40
def traverse(order = :pre, &block)
  @root_node.traverse(order, &block)
end