nitpick: Why mention the regex in the exception? you're only testing the hostgroup here