def get_fact(fixture, fact_name)
      pointer = fixture.facts

      # Get the fact of interest from the fixture, whether structured or not.
      components = fact_name.split(".")
      first_component = components.shift
      return unless pointer.key?(first_component)

      # For simple non-structured facts, just return the value.
      return pointer[first_component].value if components.empty?

      # Structured facts: dig into the structure.
      pointer = pointer[first_component].value
      last_component = components.pop
      components.each do |part|
        return unless pointer.key?(part)
        return unless pointer[part].is_a?(Hash)
        pointer = pointer[part]
      end
      pointer[last_component]
    end
def get_fact(fixture, fact_name)
      pointer = fixture.facts

      # Get the fact of interest from the fixture, whether structured or not.
      components = fact_name.split(".")
      first_component = components.shift
      return unless pointer.key?(first_component)

      # For simple non-structured facts, just return the value.
      return pointer[first_component].value if components.empty?

      # Structured facts: dig into the structure.
      pointer = pointer[first_component].value
      last_component = components.pop
      components.each do |part|
        return unless pointer.key?(part)
        return unless pointer[part].is_a?(Hash)
        pointer = pointer[part]
      end
      pointer[last_component]
    end
Extract a (possibly) structured fact.

 fixture   - Fact fixture, must respond to .facts
 fact_name - A String with the name of the fact

 Returns the value of the fact, or nil if fact or structure does not exist.