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