This is kind of an odd test, because the only way @pending_changes can be true is if a setter (prop=) was called. 

Also, since with memoization, any reference to host_dns (method) will initialize to an empty hash (which evaluates to true), a safer test would be

    raise Puppet::Error, "DNS settings not found for #{resource[:name]}" if host_dns.empty?