A small test that will use dfs() for root node First, then for the Second node. The dfs accepts a code block, and here we just print each visited node and will never find the goal-node. The tests output: Building Graph for tests... Testing from root node 'First' goal_node